Extract Variable Text String

Abraxas365

New Member
Joined
Mar 22, 2019
Messages
4
Ok, I got a bunch of data rows with the following kind of data:

FACILITYID</td><td>H1676</td></
FACILITYID</td><td>PN1354</td>
FACILITYID</td><td>61523/54712</

... and so on.

I need to extract the unique data, no matter the length, from each cell. Unfortunately, a lot of characters like "<" are repeated, so I don't know how to tell Excel to stop at a certain "<" and give me an answer with a variable length that doesn't include any "<" or "/" (except in situations like the 3rd row, where I need the 10 digit number separated by "/".

All cells begin with "FACILITYID</td><td>" and then it's the number I want, and then it's junk for a couple of characters that I don't need.

Any help would be appreciated!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Welcome to the Board...

Show us the expected extracted data results for each of the 2 given rows. I guess your data is all in Column A. If not tell us more...
 
Upvote 0
Hi,

Based on your 3 samples and written description, try these, either B1 or C1 formula copied down:


Book1
ABC
1FACILITYIDH1676H1676H1676
2FACILITYIDPN1354PN1354PN1354
3FACILITYID61523/54712</</td>61523/5471261523/54712
Sheet641
Cell Formulas
RangeFormula
B1=TRIM(LEFT(SUBSTITUTE(MID(A1,20,99),"<",REPT(" ",99)),99))
C1=TRIM(MID(SUBSTITUTE(A1,"<",REPT(" ",99),3),20,99))
 
Upvote 0
Hi,

Based on your 3 samples and written description, try these, either B1 or C1 formula copied down:

ABC
1FACILITYID</td><td>H1676</td></H1676H1676
2FACILITYID</td><td>PN1354</td>PN1354PN1354
3FACILITYID</td><td>61523/54712</61523/5471261523/54712

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

Worksheet Formulas
CellFormula
B1=TRIM(LEFT(SUBSTITUTE(MID(A1,20,99),"<",REPT(" ",99)),99))
C1=TRIM(MID(SUBSTITUTE(A1,"<",REPT(" ",99),3),20,99))

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

<tbody>
</tbody>

I realized after I posted that some of the cell information was being translated (like code) and didn't know how to edit it. I was working on a reply to clear it up but you guys knew what I wanted anyway.

When I try this, all my results begin with "d>" but I changed 20 to 22 and it works.

Thanks so much!
 
Upvote 0
You're welcome, you must have 2 additional leading characters that I couldn't account for, but glad it works for you.

Welcome to the forum.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,694
Members
448,979
Latest member
DET4492

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