LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #15   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Extracting the last set of words from a text string

On Thu, 1 Mar 2007 13:43:00 -0800, IPerlovsky
wrote:

Okay. I got one that works for all strings in the set:

=TRIM(IF(OR(RIGHT(B2,2)=" Y",RIGHT(B2,2)="
N",ISNUMBER(RIGHT(B2,1)*1)=TRUE),"",TEXTREVERSE(L EFT(TEXTREVERSE(B2),REGEX.FIND(TEXTREVERSE(B2),"\s N\s|\sY\s|\d",1)-1))))

Ah, TEXTREVERSE...................



2/26/2007 LA 988844-CN ZACHARY LA CMNTY SC 1000000 4 3/1/2008 CIFG 100.311
3.64 3.59 5 Y AAA N

with your formula above gives:

AAA N


On the other hand, this modification of my previous seems to work on all the
examples you've posted:

=IF(REGEX.COMP(A1,"([\s\S]+)\s(N|[-+]?\d*\.?\d+)(\s|$)([A-Z\d\s]*$)"),
REGEX.SUBSTITUTE(A1,"([\s\S]+)\s(N|[-+]?\d*\.?\d+)(\s|$)([A-Z\d\s]*$)","[4]"),"")
--ron


 
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 a numbers from a text string IPerlovsky Excel Worksheet Functions 24 February 27th 07 04:55 PM
Extracting Info From Within A Text String nospaminlich Excel Worksheet Functions 4 January 31st 07 10:31 PM
Extracting a word from a text string Nadeem Excel Discussion (Misc queries) 3 October 12th 06 09:17 AM
Extracting a number in a text string Pogo Excel Worksheet Functions 5 July 17th 06 06:42 PM
Extracting from a text string AmyTaylor Excel Worksheet Functions 3 June 24th 05 01:34 PM


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