LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default I need to search for then extract a specific portion of cell d

On Tue, 05 Sep 2006 21:11:27 -0400, Ron Rosenfeld
wrote:

I missed one.

What do you want returned for:

5054-SUA-US

I'm assuming you want a blank. If that is the case, change the formula to:

=REGEX.MID(A1,"(?<=\D)\d+",-1)


The following should be more "robust" depending on what you want. It's rule is
that it will return the last set of digits in the string only if they are NOT
followed by other alphanumeric characters.

=REGEX.MID(A1,"\d+(?!.*\w)",-1)

So this formula will return a null string ("") given:

5054-123-US


The first formula:

=REGEX.MID(A1,"(?<=\D)\d+",-1)

will return "123"


--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
Extract portion of cell contents Rick[_10_] Excel Worksheet Functions 7 December 19th 09 12:27 AM
Extract portion of a cell Secret Squirrel Excel Discussion (Misc queries) 4 October 26th 08 05:24 AM
Extract a specific portion of text as new cell value Craig860 Excel Discussion (Misc queries) 6 March 20th 08 05:06 PM
Extract portion of formula resident in a cell JASelep Excel Worksheet Functions 2 August 29th 07 04:25 PM
I need to search for then extract a specific portion of cell data... Ken Excel Worksheet Functions 15 September 6th 06 11:53 AM


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