Counting number of occurrences in column?

前端 未结 6 610
野的像风
野的像风 2020-12-04 09:41

What would be a good approach to calculate the number of occurrences in a spreadsheet column? Can this be done with a single array formula?

Example (column

6条回答
  •  执念已碎
    2020-12-04 10:26

    Put the following in B3 (credit to @Alexander-Ivanov for the countif condition):

    ={UNIQUE(A3:A),ARRAYFORMULA(COUNTIF(UNIQUE(A3:A),"=" & UNIQUE(A3:A)))}
    

    Benefits: It only requires editing 1 cell, it includes the name filtered by uniqueness, and it is concise.

    Downside: it runs the unique function 3x

    To use the unique function only once, split it into 2 cells:

    B3: =UNIQUE(A3:A)

    C3: =ARRAYFORMULA(COUNTIF(B3:B,"=" & B3:B))

提交回复
热议问题