Counting # of items in a single cell

CentaurSaratoga

New Member
Joined
May 10, 2010
Messages
15
Hi there, I'm trying to count the number of items in a single cell, for example: 1,2,5,9 should = 4. Thank you in advance for your help! :)
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi CentaurSaratoga and welcome to the board
If your data are in A1 and divided by coma.

=LEN(TRIM(SUBSTITUTE(A1,",","")))
 
Upvote 0
Hello again! The formula works wonderfully, but only for whole numbers. Is there a way that the formula could work for these numbers:

A: 3/5,6/5, etc. <<--- This method preferably, or
B: .6,1.2, etc.

Thanks again gentlemen!
 
Upvote 0
Robert Mika's formula gives a count of digits (7,13 would result in 3), my formula gives a count of numbers (7,13 would result in 2).

It appears that Robert's formula is your desire, so modified for your first preference it would be : =LEN(TRIM(SUBSTITUTE(SUBSTITUTE(A1,",",""),"/","")))
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,159
Members
452,892
Latest member
yadavagiri

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