Counting the amount of numbers that show up in Column

uschad

New Member
Joined
Jul 19, 2011
Messages
2
I have a column that has cells that have multiple numbers in them separated by commas:

1,2,3
2,5,7
1
1,8,9,10

I need a formula that will return the number of times that a particular number shows up in the column. So for the number 1 the formula would return 3 instances, and for the number 2 it would return 2 instances and so on. I have used this formula and it seems to do what I need except for the numbers 1 and 10.

=SUM(LEN(range)-LEN(SUBSTITUTE(range,"2",""))) in array.

Any help would be appreciated.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Let's assume that A2:A5 contains the data, let C2 contain 1, C3 contain 2, C4 contain 3, and so on, and then try...

D2, copied down:

=SUMPRODUCT(LEN(","&$A$2:$A$5&",")-LEN(SUBSTITUTE(","&$A$2:$A$5&",",","&C2&",","")))/LEN(","&C2&",")
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,334
Members
452,907
Latest member
Roland Deschain

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