Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 17
Default Help With Address Function

Steve M skrev:
I am looking for a formula that will return all words except for the last
word.
Eample:. in cell A1 I have: 325 Castleton Parkway Blvd--I want to
return in cell A2: 325 Castleton Parkway


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


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Help With Address Function

On Wed, 29 Nov 2006 09:10:47 -0500, "Steve M"
wrote:

Steve M skrev:
I am looking for a formula that will return all words except for the last
word.
Eample:. in cell A1 I have: 325 Castleton Parkway Blvd--I want to
return in cell A2: 325 Castleton Parkway


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
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 26
Default Help With Address Function

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," ",""))))))

"Steve M" wrote in message
...
Steve M skrev:
I am looking for a formula that will return all words except for the
last word.
Eample:. in cell A1 I have: 325 Castleton Parkway Blvd--I want to
return in cell A2: 325 Castleton Parkway


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




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 318
Default Help With Address Function

Hi Steve,

You could try this more concise array formula.
=MID(C13,1,MAX((MID(C13,COLUMN(1:1),1)=" ")*COLUMN(1:1))-1)
However, it has the problem that it is an array formula and hence slower
than non array formulas.

"Steve M" wrote:

Steve M skrev:
I am looking for a formula that will return all words except for the last
word.
Eample:. in cell A1 I have: 325 Castleton Parkway Blvd--I want to
return in cell A2: 325 Castleton Parkway


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



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
Get cell address from macro function argument oscar New Users to Excel 3 June 1st 06 01:23 AM
numerical integration integreat Excel Discussion (Misc queries) 4 May 12th 06 02:40 AM
ADDRESS function Michael Link Excel Discussion (Misc queries) 2 August 5th 05 02:29 PM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM
Use address function or other Doug Laidlaw Excel Worksheet Functions 1 February 24th 05 02:12 PM


All times are GMT +1. The time now is 07:27 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"