close

I have a string of numbers (ex. 123111222333123321). Is there a function that
would allow me to count how many 1's, 2's and 3's are in the string?
--
Caloyski

Try a formula like

=LEN(A1)-LEN(SUBSTITUTE(A1,1,quot;quot;))

This will return the number of 1's in cell A1.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.comquot;caloyquot; gt; wrote in message
...
gt;I have a string of numbers (ex. 123111222333123321). Is there a
gt;function that
gt; would allow me to count how many 1's, 2's and 3's are in the
gt; string?
gt; --
gt; Caloyski
Yes, compare the length of the string with and without a character:

=LEN(A1)-LEN(SUBSTITUTE(A1,quot;1quot;,quot;quot;))

--
Gary's Studentquot;caloyquot; wrote:

gt; I have a string of numbers (ex. 123111222333123321). Is there a function that
gt; would allow me to count how many 1's, 2's and 3's are in the string?
gt; --
gt; Caloyski

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()