Results 1 to 3 of 3

Thread: Count Values

  1. #1
    Join Date
    Sep 2005
    Location
    Utah
    Posts
    136

    Unanswered: 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.

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    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
    Home | Blog

  3. #3
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •