Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default How do I count the Characters in a cell

What formula would I need to apply to count the characters in a cell and not
count spaces. e.g. Tom T Tucker = 10 not 12 as with the formula =LEN(A1).
Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How do I count the Characters in a cell

=len(substitute(a1," ",""))

You didn't ask, but if you wanted to count the spaces:
=len(a1)-len(substitute(a1," ",""))


Woozy wrote:

What formula would I need to apply to count the characters in a cell and not
count spaces. e.g. Tom T Tucker = 10 not 12 as with the formula =LEN(A1).
Thanks in advance.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default How do I count the Characters in a cell

Try this:

=LEN(SUBSTITUTE(A1," ",""))

--
Biff
Microsoft Excel MVP


"Woozy" wrote in message
...
What formula would I need to apply to count the characters in a cell and
not
count spaces. e.g. Tom T Tucker = 10 not 12 as with the formula =LEN(A1).
Thanks in advance.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default How do I count the Characters in a cell

On Wed, 7 Jan 2009 19:26:17 -0800, Woozy
wrote:

What formula would I need to apply to count the characters in a cell and not
count spaces. e.g. Tom T Tucker = 10 not 12 as with the formula =LEN(A1).
Thanks in advance.


=len(substitute(a1," ",""))

--ron
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default How do I count the Characters in a cell

Thanks thats just the job. I don't suppose I could change the formula to
ignore punctution marks, or is that asking a bit much.

"Dave Peterson" wrote:

=len(substitute(a1," ",""))

You didn't ask, but if you wanted to count the spaces:
=len(a1)-len(substitute(a1," ",""))


Woozy wrote:

What formula would I need to apply to count the characters in a cell and not
count spaces. e.g. Tom T Tucker = 10 not 12 as with the formula =LEN(A1).
Thanks in advance.


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default How do I count the Characters in a cell

Hi,

Its not too much to ask -

Try:
=LEN(SUBSTITUTE(A1,"
",""))-SUMPRODUCT(--(ISNUMBER(FIND({",";".";"?";"!"},A1))))

or its equivalent with the puctuations characters entered in cells:

=LEN(SUBSTITUTE(A1," ",""))-SUMPRODUCT(--(ISNUMBER(FIND(D1:D4,A1))))

Where D1:D4 contain , (comma) . (period), ? and !.

You can have as many punctuations in the range D1:Dn but no punctuation can
appear more than once in the cell being tested.

If you are looking at names, as your initial post suggested, the one
punctuation that might appear more than once is the period, to handle that
use a modified version of the first formula:

=LEN(SUBSTITUTE(SUBSTITUTE(A1,"
",""),".",""))-SUMPRODUCT(--(ISNUMBER(FIND(D1:D3,A1))))

In this case notice that the . (period) is not included in the range D1:D3.

If you want to get much fancier you probably should consider a VBA custom
function.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"Woozy" wrote:

Thanks thats just the job. I don't suppose I could change the formula to
ignore punctution marks, or is that asking a bit much.

"Dave Peterson" wrote:

=len(substitute(a1," ",""))

You didn't ask, but if you wanted to count the spaces:
=len(a1)-len(substitute(a1," ",""))


Woozy wrote:

What formula would I need to apply to count the characters in a cell and not
count spaces. e.g. Tom T Tucker = 10 not 12 as with the formula =LEN(A1).
Thanks in advance.


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Characters in A Cell Daren Excel Discussion (Misc queries) 4 October 1st 08 02:34 PM
Count Characters in a cell tracktor Excel Discussion (Misc queries) 8 May 21st 08 03:02 AM
How can I count the number of characters on a cell? EddieDial800 Excel Discussion (Misc queries) 11 May 22nd 07 04:29 PM
Count Characters with space in a cell NH Excel Discussion (Misc queries) 5 April 5th 07 05:07 AM
Count Number of Characters in a cell? AHJuncti Excel Discussion (Misc queries) 2 June 16th 05 07:39 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"