#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Michael
 
Posts: n/a
Default Extracting Text

I have cells that contain data in this format:
ANIMALS-PETS-DOGS-BROWN
ANIMALS-PETSFARM-DOGS-BEAGLES
ANIMALS-PET-CATS-TABBY

What I need is the ability to extract only the last word after the last
hyphen so my cells look like this:
BROWN
BEAGLES
TABBY
I am getting lost
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default Extracting Text


With your data in A1

=REPLACE(A1,1,LOOKUP(LEN(A1)+1,FIND("-",A1,ROW(INDIRECT("1:"&LEN(A1))))),"")


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=523228

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Michael
 
Posts: n/a
Default Extracting Text

Thanks that one did the trick for me.

"daddylonglegs" wrote:


With your data in A1

=REPLACE(A1,1,LOOKUP(LEN(A1)+1,FIND("-",A1,ROW(INDIRECT("1:"&LEN(A1))))),"")


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=523228


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR
 
Posts: n/a
Default Extracting Text

=MID(A1,FIND("-",A1,FIND("-",A1,FIND("-",A1,1)+1)+1)+1,99)

Vaya con Dios,
Chuck, CABGx3



"Michael" wrote:

I have cells that contain data in this format:
ANIMALS-PETS-DOGS-BROWN
ANIMALS-PETSFARM-DOGS-BEAGLES
ANIMALS-PET-CATS-TABBY

What I need is the ability to extract only the last word after the last
hyphen so my cells look like this:
BROWN
BEAGLES
TABBY
I am getting lost

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
Extracting text from a cell entry morchard Excel Discussion (Misc queries) 2 July 6th 05 03:53 PM
Extracting Surname from within a text string Iainkerr01 Excel Worksheet Functions 6 March 14th 05 10:16 AM
Autofitting a row Josephine Excel Discussion (Misc queries) 2 March 3rd 05 03:37 PM
Extracting and using Text from external sources Palmley Excel Worksheet Functions 6 January 14th 05 12:22 AM
Read Text File into Excel Using VBA Willie T Excel Discussion (Misc queries) 13 January 8th 05 12:37 AM


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"