Bud
Bud

Reputation: 781

Excel - Function To Count All Strings In Range

I'm looking for a function that would count all of the different occcurrences of different strings within a range. It would go through an input range, cell by cell and, for each unique value it finds, it would count the number of occurrences of that value in the range.

So, for example, if I were to run it on this range:

enter image description here

I would get this result:

enter image description here

Thanks in advance for any help.

Upvotes: 0

Views: 215

Answers (2)

Scott Craner
Scott Craner

Reputation: 152450

It would be easiest to create a pivot table, which will create the uniques list and the count:

Put the string column in both the rows and the values.

enter image description here

Upvotes: 3

M_Kos
M_Kos

Reputation: 78

The easiest way to do it is with =COUNTIF() function.

The first argument it takes is the data range, the second - the value it will be seeking. So, for your example, the cells to count the Hellos, Goodbyes and Seeyas should look like that:

=COUNTIF(A1:A6, "Hello")
=COUNTIF(A1:A6, "Goodbye")
=COUNTIF(A1:A6, "See ya")

Upvotes: 0

Related Questions