Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Steve Madden
 
Posts: n/a
Default Finding All but Last Word

I work with street names. I know how to find the suffix or last word in a
cell, but I want to find all EXCEPT the last word in a cell. For example, if
cell A2 contained the Name Orchard Trail Rd, I would like a formula that
would return Orchard Trail. If the street name was Duke of Gloucester
Drive, I would like the formula to return Duke of Gloucester.

TIA


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default Finding All but Last Word

One way

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


--

Regards,

Peo Sjoblom


"Steve Madden" wrote in message
news:Yjbxf.52522$ih5.7457@dukeread11...
I work with street names. I know how to find the suffix or last word in a
cell, but I want to find all EXCEPT the last word in a cell. For example,

if
cell A2 contained the Name Orchard Trail Rd, I would like a formula that
would return Orchard Trail. If the street name was Duke of Gloucester
Drive, I would like the formula to return Duke of Gloucester.

TIA




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Finding All but Last Word

Try this:
For A1 containing the text
B1: =LEFT(A1,LEN(A1)-MATCH("
",MID(A1,LEN(A1)+1-ROW(INDIRECT("1:"&(LEN(A1)))),1),0))
note: commit that array formula by holding down [Ctrl]+[Shift] and press
[Enter]

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"Steve Madden" wrote:

I work with street names. I know how to find the suffix or last word in a
cell, but I want to find all EXCEPT the last word in a cell. For example, if
cell A2 contained the Name Orchard Trail Rd, I would like a formula that
would return Orchard Trail. If the street name was Duke of Gloucester
Drive, I would like the formula to return Duke of Gloucester.

TIA



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default Finding All but Last Word

Here's a non-array formula that also works:

B1: =LEFT(A1,SEARCH("^^",SUBSTITUTE(A1," ","^^",LEN(A1)-LEN(SUBSTITUTE(A1,"
",""))))-1)


***********
Regards,
Ron

XL2002, WinXP-Pro


"Steve Madden" wrote:

I work with street names. I know how to find the suffix or last word in a
cell, but I want to find all EXCEPT the last word in a cell. For example, if
cell A2 contained the Name Orchard Trail Rd, I would like a formula that
would return Orchard Trail. If the street name was Duke of Gloucester
Drive, I would like the formula to return Duke of Gloucester.

TIA



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default Finding All but Last Word

Steve Madden wrote...
I work with street names. I know how to find the suffix or last word in a
cell, but I want to find all EXCEPT the last word in a cell. For example, if
cell A2 contained the Name Orchard Trail Rd, I would like a formula that
would return Orchard Trail. If the street name was Duke of Gloucester
Drive, I would like the formula to return Duke of Gloucester.


If you have the last word of a string, which I'll denote LW, then the
portion to the left of it would just be

=LEFT(s,LEN(s)-LEN(LW)-1)

Without the last word, you could define a name like seq referring to a
formula like

=ROW(INDEX($1:$65536,1,1):INDEX($1:$65536,256,1))

which would evaluate to an array of sequential integers, then use a
formula like

=LEFT(s,LOOKUP(2,1/(MID(s,seq,1)=" "),seq)-1)



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Steve Madden
 
Posts: n/a
Default Finding All but Last Word

I tried this but it returned #VALUE! instead of the last word.
"Peo Sjoblom" wrote in message
...
One way

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


--

Regards,

Peo Sjoblom


"Steve Madden" wrote in message
news:Yjbxf.52522$ih5.7457@dukeread11...
I work with street names. I know how to find the suffix or last word in

a
cell, but I want to find all EXCEPT the last word in a cell. For

example,
if
cell A2 contained the Name Orchard Trail Rd, I would like a formula that
would return Orchard Trail. If the street name was Duke of Gloucester
Drive, I would like the formula to return Duke of Gloucester.

TIA






  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben
 
Posts: n/a
Default Finding All but Last Word

Steve

Works for me with the two examples you provided.

Did you type in or copy Peo's formula correctly?

Is your data exactly as your examples indicate?

Do you have data in A1?

I get the #VALUE! error if no data to parse.


Gord Dibben MS Excel MVP


On Fri, 20 Jan 2006 16:04:39 -0500, "Steve Madden"
wrote:

I tried this but it returned #VALUE! instead of the last word.
"Peo Sjoblom" wrote in message
...
One way

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


--

Regards,

Peo Sjoblom


"Steve Madden" wrote in message
news:Yjbxf.52522$ih5.7457@dukeread11...
I work with street names. I know how to find the suffix or last word in

a
cell, but I want to find all EXCEPT the last word in a cell. For

example,
if
cell A2 contained the Name Orchard Trail Rd, I would like a formula that
would return Orchard Trail. If the street name was Duke of Gloucester
Drive, I would like the formula to return Duke of Gloucester.

TIA






  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Krishnakumar
 
Posts: n/a
Default Finding All but Last Word


=left(a1,lookup(len(a1),find(" ",a1,row($a$1:index($a:$a,len(a1)))))-1)


--
Krishnakumar


------------------------------------------------------------------------
Krishnakumar's Profile: http://www.excelforum.com/member.php...o&userid=20138
View this thread: http://www.excelforum.com/showthread...hreadid=500266

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
Linking table in Excel to word travis Links and Linking in Excel 1 November 19th 05 02:30 PM
how do you get Word to open documents in it's own window(s)? othree7 Excel Discussion (Misc queries) 0 November 16th 05 04:21 PM
Print Excel charts in Word 2003 with fixed size Phil Charts and Charting in Excel 1 November 3rd 05 04:24 AM
Finding specific word in column Phil #3 Excel Worksheet Functions 3 March 28th 05 09:00 AM
Finding Words In Excel Spreadsheets & Word Documents rbonner79416 Excel Discussion (Misc queries) 0 March 18th 05 04:25 PM


All times are GMT +1. The time now is 02:50 AM.

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"