Forum Discussion

Bill812's avatar
Bill812
Copper Contributor
Mar 16, 2021

Counting occurences in a column

Hi ... I have a very long list of town names, more than 3,000. I would like to write a formula that would go down the column, and count the occurrences of each town name, if that's possible. I'm not talking about a COUNTIF that requires the criteria to be specified, I'm wondering if it's possible to automate that process. Thanks.

3 Replies

  • Bill812 

    Why so dismissive of COUNTIF?  The formula

    = COUNTIFS(city, city)

    cannot be that much of a problem.

    Better, with 365, might be

    = LET(
      distinct,     SORT(UNIQUE(city)),
      occurrences,  COUNTIFS(city,distinct),
      CHOOSE({1,2}, distinct, occurrences))

    The entire set of result is generated by a single formula cell

     

Resources