If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Count Values

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-09-07, 15:54
Zenaida Zenaida is offline
Registered User
 
Join Date: Sep 2005
Location: Utah
Posts: 136
Count Values

I run a report from a Customer Relation Management Tool. I'm able to export the information into Excel. The report shows the cities and states that customers live in.

The only fields I export are the city and state. So if I have 50 customers that live in Las Vegas Nevada, Las Vegas Nevada would be listed 50 times.

I need to get a count of the number of times each city is listed. Because the same cities don't always show up on the report when I run it, I'm not sure how to automate it.

Is there a way to do this with a function?

Thanks.
__________________
Thanks,
Zenaida


- If you've never made a mistake, you've never made anything.
Reply With Quote
  #2 (permalink)  
Old 06-10-07, 09:02
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
The following is an SQL query that would give you the answer you wanted.
Code:
SELECT City, State, Count(*)
FROM MyTable
GROUP BY City, State
Start to think of your columns as columns in a table.
HTH
__________________
George
Twitter | Blog
Reply With Quote
  #3 (permalink)  
Old 06-10-07, 21:23
Zenaida Zenaida is offline
Registered User
 
Join Date: Sep 2005
Location: Utah
Posts: 136
Thanks for your reply. In Excel, where would I enter the code? Would the syntax you wrote work in Excel? Thanks.
__________________
Thanks,
Zenaida


- If you've never made a mistake, you've never made anything.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On