ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   len() (https://www.excelbanter.com/excel-discussion-misc-queries/10309-len.html)

excelFan

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


Don Guillett

Maybe you need to re-state your question.

--
Don Guillett
SalesAid Software

"excelFan" wrote in message
...
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




T Kirtley

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


excelFan

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



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

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