#1   Report Post  
excelFan
 
Posts: n/a
Default len()

hi all,
please help finding the correct length!
A1=123 7 (note: in A1 there are 4 spaces between the 3 and the 7).
now the formula RIGHT(A1,4) will yield 7
in looking for the length of this result (the 7) suing the formula
LEN(RIGHT(A1,4)) this will produce 4, where i'm assuming to be 1 , similarly
if A1=123 78 then RIGHT(A1,5) is 78 and the LEN(RIGHT(A1,5)) will give 5
where i'm waiting to see 2
thanks for any help

  #3   Report Post  
T Kirtley
 
Posts: n/a
Default

The Right() function counts all characters, including spaces. If you request
5 characters you will get a length of 5.

If you want to return the length of the non-space characters try something
like:

=LEN(TRIM(RIGHT(A1,4)))



"excelFan" wrote:

hi all,
please help finding the correct length!
A1=123 7 (note: in A1 there are 4 spaces between the 3 and the 7).
now the formula RIGHT(A1,4) will yield 7
in looking for the length of this result (the 7) suing the formula
LEN(RIGHT(A1,4)) this will produce 4, where i'm assuming to be 1 , similarly
if A1=123 78 then RIGHT(A1,5) is 78 and the LEN(RIGHT(A1,5)) will give 5
where i'm waiting to see 2
thanks for any help

  #4   Report Post  
excelFan
 
Posts: n/a
Default

many thanks "T Kirtley"
your TRIM made it just fine. happy new year

"T Kirtley" wrote:

The Right() function counts all characters, including spaces. If you request
5 characters you will get a length of 5.

If you want to return the length of the non-space characters try something
like:

=LEN(TRIM(RIGHT(A1,4)))



"excelFan" wrote:

hi all,
please help finding the correct length!
A1=123 7 (note: in A1 there are 4 spaces between the 3 and the 7).
now the formula RIGHT(A1,4) will yield 7
in looking for the length of this result (the 7) suing the formula
LEN(RIGHT(A1,4)) this will produce 4, where i'm assuming to be 1 , similarly
if A1=123 78 then RIGHT(A1,5) is 78 and the LEN(RIGHT(A1,5)) will give 5
where i'm waiting to see 2
thanks for any help

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



All times are GMT +1. The time now is 07:41 PM.

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

About Us

"It's about Microsoft Excel"