ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Counting the number of letters in a cell (https://www.excelbanter.com/excel-discussion-misc-queries/28828-counting-number-letters-cell.html)

beefycj5

Counting the number of letters in a cell
 

Can Excel count the numbers of letters in a cell that has mixed letters
and numbers? Can you restrict =LEN to only letters (or only numbers)?

IE - ABC123
# of letters = 3

Thanks,
Adam


--
beefycj5
------------------------------------------------------------------------
beefycj5's Profile: http://www.excelforum.com/member.php...o&userid=16353
View this thread: http://www.excelforum.com/showthread...hreadid=375769


MartinShort


Are they always in the same format Adam? ie 3 letters, 3 numbers. If
they are try a combination of the LEFT and LEN functions.

ie *=LEN(LEFT(A1))* etc.

If the pattern is irregular, yes you can do it, but you would need to
write a small macro. To help you, we would also need more precise
rules. ie What would you want to extract if the cell contained
A23BGF44?

Martin


--
MartinShort

Software Tester
------------------------------------------------------------------------
MartinShort's Profile: http://www.excelforum.com/member.php...o&userid=22034
View this thread: http://www.excelforum.com/showthread...hreadid=375769


Ron Coderre


See if this works for you:

=LEN(A1)-SUMPRODUCT(LEN(A1)-LEN(SUBSTITUTE(A1,{0,1,2,3,4,5,6,7,8,9},"")))

It should accommodate any combination of text and numbers.

Regards,
Ron


--
Ron Coderre
------------------------------------------------------------------------
Ron Coderre's Profile: http://www.excelforum.com/member.php...o&userid=21419
View this thread: http://www.excelforum.com/showthread...hreadid=375769



All times are GMT +1. The time now is 04:15 PM.

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