View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Bob Freeman Bob Freeman is offline
external usenet poster
 
Posts: 20
Default Identifying text within a cell

Thank you Peo.

As you said, this works perfectly when there are no other numeric values in
the string and will be very useful.

You correctly predicted that there will be times where there will be several
other numbers in the string of text both before and after the string to be
looked at.

e.g.

5 xyz 152X30.5MM 670gsm (EKEE4)

Many thanks.



"Peo Sjoblom" wrote:

Can there be more than one occasion of numbers like in your example or can
there be strings like


"One ream of paper at 670gsm including 450 etc"

if the numbers right before gsm is the only numerical occurrence you can use


=--MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"01234567 89")),SEARCH("gsm",A1)-MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")))


with your string in A1


--


Regards,


Peo Sjoblom

"Bob Freeman" wrote in message
...
Hello,

I am trying to pull out one string of text within a cell.

e.g. any string of text containing "gsm" from the following:

"One ream of paper at 670gsm" (which would return a value of either 670gsm
or ideally 670)

Not convinced that this is possible but any help gratefully received.

Many thanks,

Bob