Grouping a column and finding count of each entry

ankita.sethi

Board Regular
Joined
Apr 27, 2011
Messages
58
Hi,

In a particular column of an excel sheet, I want a formula (VBA or worksheet) gives the count of each enrty in that column.

let's say column name is Animals

Animals
Cat
Dog
Dog
Dog
Cat
Rabbit

That Formula should be able to tell me #Cat = 2, #Dog = 3, #Rabbit =1.

Is this possible to do with sumproduct by any chance?

Please advice! This will make my life much simpler!
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Probably not exactly what you are after, but here is a simple solution. Assuming your data is in Column A, put this in B2 (the cell after the header row) and copy it down...

=IF(COUNTIF(A$1:A2,A2)=1,COUNTIF(A:A,A2),"")

The total count of each animal will appear next to the first occurence of that animal's name in the column.
 
Upvote 0
Hi, thanks for the reply!

However, what I would like is for a sort of a table to be created with two columns - one with unique values and second with their respective counts.
(I hope I am making sense :P ; if not, please let me know and I will try to be more elaborate)

Thanks a lot!
 
Upvote 0

Forum statistics

Threads
1,224,504
Messages
6,179,142
Members
452,892
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top