View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default Numbers after specific text

Steve wrote...
The following data is entered in a cell:

P5-MPC FT 18, P5-MPC FT 25, P5-MPC FT 30, P5-MPC FT 35,P5-MPC PTR 1,
P5-MPC PTF 9

The P5-MPC text is irrelevent. I need the #'s after each FT, after each PTR
and after each PTF, so that my resulting data would be:

FT18
FT25
FT30
FT35
PTR1
PTF1

Could the above be returned in 6 different cells even if the original data
is all in one cell?

....

The easiest way to do this uses two cells per result. With your string
in cell A1 and the first result in cell D3, try these formulas.

C3:
=MIN(FIND({" FT";" PTR";" PTF"},A1&" FT PTR PTF"))+1

D3:
=MID(A$1,C3,FIND(",",A$1&",",C3)-C3)

C4:
=MIN(FIND({" FT";" PTR";" PTF"},A$1&" FT PTR PTF",C3+LEN(D3)))+1

D4:
=MID(A$1,C4,FIND(",",A$1&",",C4)-C4)

Select C4:D4 and fill down as far as needed, in this case through C8:D8.