Help With Address Function

  • Thread starter Thread starter Steve M
  • Start date Start date
S

Steve M

Steve M skrev:
Bondi supplied this formula :
=LEFT(A1,LEN(A1)-LEN(RIGHT(A1,LEN(A1)-FIND("^^",SUBSTITUTE(A1,"
","^^",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))))

but I cannot get it to work--I get a #VALUE! result whether or not I use it
as an array.


TIA
 
Steve M skrev:

Bondi supplied this formula :
=LEFT(A1,LEN(A1)-LEN(RIGHT(A1,LEN(A1)-FIND("^^",SUBSTITUTE(A1,"
","^^",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))))

but I cannot get it to work--I get a #VALUE! result whether or not I use it
as an array.


TIA


If you are using the formula exactly as you pasted it in here, there is a line
feed in the "wrapped" first SUBSTITUTE function, instead of a <space>.

That will cause the behavior you are seeing.

This should correct that:

=LEFT(A1,LEN(A1)-LEN(RIGHT(A1,LEN(A1)-
FIND("^^",SUBSTITUTE(A1," ","^^",LEN(A1)-
LEN(SUBSTITUTE(A1," ","")))))))

Or you can do it manually yourself.


--ron
 
See if this will work:

=IF(LEN(A1)-LEN(SUBSTITUTE(A1,"
",""))=0,A1,LEFT(A1,LEN(A1)-(LEN(A1)-FIND("*",SUBSTITUTE(A1,"
","*",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))))

If there is only one word/num in the address for some reason, the above
formula will return that word/num. If that is not an issue, get rid of the
IF as such:

=LEFT(A1,LEN(A1)-(LEN(A1)-FIND("*",SUBSTITUTE(A1,"
","*",LEN(A1)-LEN(SUBSTITUTE(A1," ",""))))))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top