Extract mixed of text numbers characters

sotor

New Member
Joined
Nov 8, 2018
Messages
23
Office Version
  1. 2019
  2. 2016
  3. 2013
  4. 2010
Platform
  1. Windows
I tried to extract mixed text & numbers using formula =MID(LEFT(A1,FIND("T",A1)+9),FIND("T",A1)+0,LEN(A1))
I also tried extending it for other mixed characters but not having much luck.

Anyone have a solution for the data below?

Detail
Result needed
F-001\017548942\T048321/EM/41/KC/TB/jn\
T048321EM
D-001\4535623-0001\D100492EM
D100492EM
D-041\012258188\D100035EM--17/REN\001361430-0017
D100035EM
F-005\002913831\KC/TB/B.208.0444\016300576\BT
B.208.0444
F-005\003049918\AMSF/RJP/F.043.0501\017604273\Fi
F.043.0501
F-012\006564975\AAR.24-5\AMER
AAR.24-5
F-005\003055137\KAE/SHF/K.024.0013\017872828\V
K.024.0013
F-005\003056146\M.167.0289\017825084\m
M.167.0289
F-116\000751537\MAL/CT25330\Tel
CT25330
F-020\014739422\O046865/EM/35/JML\
O046865EM

<tbody>
</tbody>
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I don't see a logical patern to put in formula and I can't even guess the part(s) that you want. Can you explain something like

if start with F and 3rd element is 7 caracter, add 4th element
or if find EM, take 8 caracters before (without /)
if element with dots, take that one
...
 
Last edited:
Upvote 0
I don't see a logical patern to put in formula and I can't even guess the part(s) that you want. Can you explain something like

if start with F and 3rd element is 7 caracter, add 4th element
or if find EM, take 8 caracters before (without /)
if element with dots, take that one
...

Tricky one.. the result needed, letters that start with F,B, K M T, D,O are 9 characters without / there are a few characters like CT25330 & AAR.24-5 that are less than 9, (7 & 8 characters).

If there is a logical solution for 9 characters I can live with that (I can do without 7 and 8 characters). :)
 
Upvote 0
Tricky one.. the result needed, letters that start with F,B, K M T, D,O are 9 characters without / there are a few characters like CT25330 & AAR.24-5 that are less than 9, (7 & 8 characters).

If there is a logical solution for 9 characters I can live with that (I can do without 7 and 8 characters). :)


Can anyone else suggest solution for the above?
 
Upvote 0
Hi,

This formula will extract what you want for your given samples.
If you have more "different" data formats, I may or may not be able to help further, see how this works for you.


Book1
AB
1Detail
2F-001\017548942\T048321/EM/41/KC/TB/jn\T048321EM
3D-001\4535623-0001\D100492EMD100492EM
4D-041\012258188\D100035EM--17/REN\001361430-0017D100035EM
5F-005\002913831\KC/TB/B.208.0444\016300576\BTB.208.0444
6F-005\003049918\AMSF/RJP/F.043.0501\017604273\FiF.043.0501
7F-012\006564975\AAR.24-5\AMERAAR.24-5
8F-005\003055137\KAE/SHF/K.024.0013\017872828\VK.024.0013
9F-005\003056146\M.167.0289\017825084\mM.167.0289
10F-116\000751537\MAL/CT25330\TelCT25330
11F-020\014739422\O046865/EM/35/JML\O046865EM
Sheet349
Cell Formulas
RangeFormula
B2=TRIM(RIGHT(SUBSTITUTE(LEFT(SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("|",SUBSTITUTE(A2,"","|",2))+1,99),"/EM","EM"),"--",""),IFERROR(FIND("EM",SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("|",SUBSTITUTE(A2,"","|",2))+1,99),"/EM","EM"),"--",""))+1,FIND("",SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("|",SUBSTITUTE(A2,"","|",2))+1,99),"/EM","EM"),"--",""))-1)),"/",REPT(" ",99)),99))


Formula copied down.
 
Upvote 0
Hi,

This formula will extract what you want for your given samples.
If you have more "different" data formats, I may or may not be able to help further, see how this works for you.

AB
1Detail
2F-001\017548942\T048321/EM/41/KC/TB/jn\T048321EM
3D-001\4535623-0001\D100492EMD100492EM
4D-041\012258188\D100035EM--17/REN\001361430-0017D100035EM
5F-005\002913831\KC/TB/B.208.0444\016300576\BTB.208.0444
6F-005\003049918\AMSF/RJP/F.043.0501\017604273\FiF.043.0501
7F-012\006564975\AAR.24-5\AMERAAR.24-5
8F-005\003055137\KAE/SHF/K.024.0013\017872828\VK.024.0013
9F-005\003056146\M.167.0289\017825084\mM.167.0289
10F-116\000751537\MAL/CT25330\TelCT25330
11F-020\014739422\O046865/EM/35/JML\O046865EM

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet349

Worksheet Formulas
CellFormula
B2=TRIM(RIGHT(SUBSTITUTE(LEFT(SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("|",SUBSTITUTE(A2,"","|",2))+1,99),"/EM","EM"),"--",""),IFERROR(FIND("EM",SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("|",SUBSTITUTE(A2,"","|",2))+1,99),"/EM","EM"),"--",""))+1,FIND("",SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("|",SUBSTITUTE(A2,"","|",2))+1,99),"/EM","EM"),"--",""))-1)),"/",REPT(" ",99)),99))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



Formula copied down.

Wow thank you, I copied the formula across but seem to get #value ! I tried to evaluate the formula but no luck. Would it be possible to send an excel file or resend the formula?
 
Upvote 0
Wow thank you, I copied the formula across but seem to get #value ! I tried to evaluate the formula but no luck. Would it be possible to send an excel file or resend the formula?

What do you mean by "Across"? As in your OP and my sample in Post # 5, Formula Copied Down Column, Not across Row.
 
Upvote 0
What do you mean by "Across"? As in your OP and my sample in Post # 5, Formula Copied Down Column, Not across Row.

Sorry my typo meant copied down.

Detail
F-001\017548942\T048321/EM/41/KC/TB/jn\
=TRIM(RIGHT(SUBSTITUTE(LEFT(SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("|",SUBSTITUTE(A2,"","|",2))+1,99),"/EM","EM"),"--",""),IFERROR(FIND("EM",SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("|",SUBSTITUTE(A2,"","|",2))+1,99),"/EM","EM"),"--",""))+1,FIND("",SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("|",SUBSTITUTE(A2,"","|",2))+1,99),"/EM","EM"),"--",""))-1)),"/",REPT(" ",99)),99))
D-001\4535623-0001\D100492EM
#VALUE!

<tbody>
</tbody>
 
Upvote 0
Don't know what your problem is, Works for me...


Book1
AB
12F-001\017548942\T048321/EM/41/KC/TB/jn\T048321EM
13D-001\4535623-0001\D100492EMD100492EM
Sheet349
Cell Formulas
RangeFormula
B12=TRIM(RIGHT(SUBSTITUTE(LEFT(SUBSTITUTE(SUBSTITUTE(MID(A12,FIND("|",SUBSTITUTE(A12,"","|",2))+1,99),"/EM","EM"),"--",""),IFERROR(FIND("EM",SUBSTITUTE(SUBSTITUTE(MID(A12,FIND("|",SUBSTITUTE(A12,"","|",2))+1,99),"/EM","EM"),"--",""))+1,FIND("",SUBSTITUTE(SUBSTITUTE(MID(A12,FIND("|",SUBSTITUTE(A12,"","|",2))+1,99),"/EM","EM"),"--",""))-1)),"/",REPT(" ",99)),99))
 
Upvote 0
I know what the problem is, the forum is NOT showing the formula correctly with MrExcelHTMLmaker.

Copy this formula:


Code:
=TRIM(RIGHT(SUBSTITUTE(LEFT(SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("|",SUBSTITUTE(A2,"\","|",2))+1,99),"/EM","EM"),"--","\"),IFERROR(FIND("EM",SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("|",SUBSTITUTE(A2,"\","|",2))+1,99),"/EM","EM"),"--","\"))+1,FIND("\",SUBSTITUTE(SUBSTITUTE(MID(A2,FIND("|",SUBSTITUTE(A2,"\","|",2))+1,99),"/EM","EM"),"--","\"))-1)),"/",REPT(" ",99)),99))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,584
Messages
6,125,673
Members
449,248
Latest member
wayneho98

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top