Count number of values in multiple cells with multiple values in each cell

Muhannad1

New Member
Joined
Jul 21, 2022
Messages
3
Office Version
  1. 2016
Platform
  1. MacOS
I have a list of cells that contain a list of names. Some cells have multiple names separated by commas.
Cell A1: Andrew
Cell A2: vanessa, christine, charlotte
Cell A3: Karl, Joe, Jason, Andrew, jonathan
etc...
I would like a count of how many names in a range of cells in column A (such as A1:A350)
I do not have a list of all names to reference as there are new ones being added all the time.

I was able to find a formula that counted how many names in each cell:
=LEN(A2)-LEN(SUBSTITUTE(A2,",",""))+1
This would tell me there are 3 names in cell A2, but I want the count of all names from a range of cells in column A (such as A1:A350)
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Welcome to the MrExcel board!

Please update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also, do you want this to be a count of 2 or a count of 3?

22 07 21.xlsm
A
1Tom
2Bob, Tom
3
Count Names
 
Upvote 0
try:
=SUMPRODUCT(LEN($A$1:$A$350&",")-LEN(SUBSTITUTE($A$1:$A$350&",",",","")))
 
Upvote 0
Welcome to the MrExcel board!

Please update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also, do you want this to be a count of 2 or a count of 3?

22 07 21.xlsm
A
1Tom
2Bob, Tom
3
Count Names
Updated account settings!
In this example, the count should be 3.
 
Upvote 0
try:
=SUMPRODUCT(LEN($A$1:$A$350&",")-LEN(SUBSTITUTE($A$1:$A$350&",",",","")))
This didn't seem to work and gave a count of 351 for some reason....

In the example I gave where:
Cell A1: Andrew
Cell A2: vanessa, christine, charlotte
Cell A3: Karl, Joe, Jason, Andrew, jonathan

I would like the count for A1:A3 to be 9 as that's how many names are in the cells.
 
Upvote 0
Try

22 07 21.xlsm
AB
1Andrew9
2vanessa, christine, charlotte
3Karl, Joe, Jason, Andrew, jonathan
4
Count Names
Cell Formulas
RangeFormula
B1B1=SUMPRODUCT(LEN($A$1:$A$350)-LEN(SUBSTITUTE($A$1:$A$350,",","")))+COUNTA(A1:A350)
 
Upvote 0
Solution
Try
=SUMPRODUCT(LEN($A$1:$A$350)-LEN(SUBSTITUTE($A$1:$A$350,",","")))+COUNTA(A1:A350)
Why did you use absolute references for the first two occurrences of the range and a relative reference for the third occurrence?
 
Upvote 0
Why did you use absolute references for the first two occurrences of the range and a relative reference for the third occurrence?
Simply because I started with the post #3 formula, edited it & added the relative reference part and forgot to remove the $ signs. :)
The mixture isn't a problem is it?
 
Upvote 0
Simply because I started with the post #3 formula, edited it & added the relative reference part and forgot to remove the $ signs. :)
The mixture isn't a problem is it?
It is to someone with OCD or to someone, like me, who has some tendencies of OCD.😲
 
Upvote 0

Forum statistics

Threads
1,214,385
Messages
6,119,208
Members
448,874
Latest member
b1step2far

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