View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default I need help extracting some data from a cell

On Mon, 11 Dec 2006 06:08:01 -0800, hshayh0rn
wrote:

I should also mention that unless the data is VARCHAR2 there is no ( to key
off of. If the value is number, date, etc... then nothing comes after it.


If that is the case, then what do you want as output.

One suggestion: Download and install Longre's free morefunc.xll add-in from
http://xcell05.free.fr/ It is easily distributed with workbooks if that is an
issue.

Then use these regular expression formulas:


To return the Last Word -- defined as the last sequence starting with the first
character after a <space and ending with an <open parenthesis, or end of
line.


=REGEX.MID(A1,"(?<=\s)[^\s\(]+",-1)

To return the last set of characters that are within parentheses (and not
return the parentheses themselves), use this Regular Expression formula:

=REGEX.MID(A1,"(?<=\()[^\)]+",-1)


"hshayh0rn" wrote:

I have a cell that contains data that needs to be broken up among a few
different cells. The source cell contains data like:

COMPANYADDRESS2 VARCHAR2(35)

I need to put 35 in one cell and then VARCHAR in another. So I need a
worksheet function that finds the number between ( and ) and then I need
another function that figures out the characters between ( and the first
space to the left of the V in varchar2. Varchar2 is just an example of what
the data could be. Other examples could be number, date, etc...


--ron