ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How to count the number of 'values' in a cell (https://www.excelbanter.com/excel-worksheet-functions/98665-how-count-number-values-cell.html)

Sandih

How to count the number of 'values' in a cell
 

Hi

I am after something that seems simple, but I can't figure out a way to
do it.

If I have a single cell containing a list of values seperated by a
comma (ie a csv list in a cell), how do I count the number of values.
I figure it must be by counting the commas somehow and then adding one
as the last doesn't have it, but there is no way to tell how many there
will be.

My cell contents look like this
18911, 18801, 18825, 18482, 18941

so I want to have another cell return the number 5.

Does anyone have any ideas?

Regards
Sandi


--
Sandih
------------------------------------------------------------------------
Sandih's Profile: http://www.excelforum.com/member.php...o&userid=36225
View this thread: http://www.excelforum.com/showthread...hreadid=560150


Sandih

How to count the number of 'values' in a cell
 

I think I have the answer I think the following function calculation
would work....

if
a1 contains 18911, 18801, 18825, 18482, 18941

then the following could give me the number of values in the cell

=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))+1


--
Sandih
------------------------------------------------------------------------
Sandih's Profile: http://www.excelforum.com/member.php...o&userid=36225
View this thread: http://www.excelforum.com/showthread...hreadid=560150



All times are GMT +1. The time now is 11:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com