Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9193791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:14:56+00:00 2026-06-17T21:14:56+00:00

I have a Google spreadsheet with a column that looks like this: City —-

  • 0

I have a Google spreadsheet with a column that looks like this:

City
----
London
Paris
London
Berlin
Rome
Paris

I want to count the appearances of each distinct city (so I need the city name and the number of appearances).

City   | Count
-------+------
London |  2
Paris  |  2
Berlin |  1
Rome   |  1

How do I do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:14:58+00:00Added an answer on June 17, 2026 at 9:14 pm

    Link to Working Examples

    Solution 0

    This can be accompished using pivot tables.

    Pivot table Example - Count rows by value

    Solution 1

    Use the unique formula to get all the distinct values. Then use countif to get the count of each value. See the working example link at the top to see exactly how this is implemented.

    Unique Values        Count
    =UNIQUE(A3:A8)       =COUNTIF(A3:A8;B3)
                         =COUNTIF(A3:A8;B4)
                         ...
    

    Solution 2

    If you setup your data as such:

    City    
    ----    
    London   1
    Paris    1
    London   1
    Berlin   1
    Rome     1
    Paris    1
    

    Then the following will produce the desired result.

    =sort(transpose(query(A3:B8,"Select sum(B) pivot (A)")),2,FALSE)
    

    I’m sure there is a way to get rid of the second column since all values will be 1. Not an ideal solution in my opinion.

    via http://googledocsforlife.blogspot.com/2011/12/counting-unique-values-of-data-set.html

    Other Possibly Helpful Links

    • http://productforums.google.com/forum/#!topic/docs/a5qFC4pFZJ8
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a google spreadsheet that looks like this, for budget keeping. I want
I have a google spreadsheet that uses this function: =SUM(E:E) - SUM(C:C) It adds
I have three scripts that are in a google docs spreadsheet. In this spreadsheet,
So I have a Google Form that feeds a Google Docs Spreadsheet. This form
I have a Google Form that feeds a Google Docs Spreadsheet. I'd like to--in
I have a google docs spreadsheet with rows like this: | | things; separated;by;semicolons;with;line;breaks
I have a user that created about 50 sheets inside a Google Spreadsheet. Each
I have a Google Spreadsheet with 3 columns that are either blank or have
I am trying to run the script above. I have a google spreadsheet that
I'd like to process the following columns in a google-spreadsheet. The Time column represents

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.