Character count in Numbers cells
I need to know the number of letters/characters inside a cell that contains a text string.
What formula can I use to do that?
Thanks a lot!
MacBook Pro Apple Silicon
I need to know the number of letters/characters inside a cell that contains a text string.
What formula can I use to do that?
Thanks a lot!
MacBook Pro Apple Silicon
Another way to do it that would also count characters other than a-z,A-Z, and 0-9 would be to to subtract the number of "white space" characters from the total number of characters. That would take into account non-english letters (including those with tildes and umlauts), hyphens, symbols, etc. I wasn't thinking about those characters yesterday.
=LEN(B2)−COUNTMATCHES(B2,REGEX("\s"))
Another way to do it that would also count characters other than a-z,A-Z, and 0-9 would be to to subtract the number of "white space" characters from the total number of characters. That would take into account non-english letters (including those with tildes and umlauts), hyphens, symbols, etc. I wasn't thinking about those characters yesterday.
=LEN(B2)−COUNTMATCHES(B2,REGEX("\s"))
=COUNTMATCHES(B2,REGEX("\w"))
will give the count of all letters and digits, ignoring spaces, tabs, carriage returns, punctuation, etc.
LENgth will give you that information:
Regards,
Barry
Barry,
Thank you very much! Exactly what I needed. And fast too!
Hi Badunit,
Thanks a lot! That was the missing part. Now I can do characters with AND without spaces!
Very helpful indeed. I really should take a course in REGEX:)
Character count in Numbers cells