Extract data after special characters

maayub

New Member
Joined
Apr 15, 2018
Messages
8
I want to extract data from a cell containing this information:

G# 202352, 202347 ZRX MED 4984 LT/PIR WE 218867 DUE 4/30[TABLE="width: 663"]
<tbody>[TR]
[TD]
G#222237/222240/222244 TUE 4911/4913/4940 PI/CFZ WE 220917 DUE 04/30
G# 202352,202347 ZRX MED 4984 LT/PIR WE 218867, 218357 DUE 4/30[TABLE="width: 663"]
<tbody>[TR]
[TD]G# 202352 ZRX MED 4984 LT/PIR WE 218867, 218357 DUE 9/14

1. I want to extract data after G#. This data is always 6 digits. This 6 digit data is sometimes in 1 set or up to 5 sets separated by a comma or /. See examples above.

2. I also want to extract the data after "WE". this data is also 6 digit long. Sometimes in 1 set or up to 5 sets.


I want both sets of data display in two different columns. How can I do that?
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Sorry, I'm still confused...
So, are you saying, if the 6 digit numbers After G# is separated by a "/", not a coma, then you Don't want it extracted?

May be, if you can show a few lines of data and what the results should be, it may be more clear.
 
Upvote 0

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
no. I want all the data extracted after G. no matter how many sets they have in column A. I want the data exactly showing in message 5, but the formula you provided - it only extract the first set of values in column B (see table 8).
 
Upvote 0
the formula is extracting multiple set of values but only if the data is separated with a /. if the data is separated with a comma it is only returning the 1st set of values.
 
Upvote 0
This is the table from Post #8 , I'm getting the correct results here...


Excel 2010
ABC
14G# 202352, 202347 ZRX MED 4984 LT/PIR WE 218867 DUE 4/30202352, 202347218867
15G#222237/222240/222244 TUE 4911/4913/4940 PI/CFZ WE 220917 DUE 04/30222237, 222240, 222244220917
16G# 202352,202347 ZRX MED 4984 LT/PIR WE 218867, 218357 DUE 4/30202352, 202347218867, 218357
17G# 202352 ZRX MED 4984 LT/PIR WE 218867, 218357 DUE 9/14202352218867, 218357
18G# 202352, 202347 ZRX MED 4984 LT/PIR WE 218867 DUE 4/30202352, 202347218867
19Differ_GQQ02_02-10_IC_18-014_Due_12/25
20G#222237/222240/222244 TUE 4911/4913/4940 PI/CFZ WE 220917 DUE 04/30222237, 222240, 222244220917
21G# 202352,202347 ZRX MED 4984 LT/PIR WE 218867, 218357 DUE 4/30202352, 202347218867, 218357
222018 BS OCM WRT Carport -ZXR-94 VIFG54 *WATER* LO (JLK 2)
23G# 202352 ZRX MED 4984 LT/PIR WE 218867, 218357 DUE 9/14202352218867, 218357
24ZRX MED 4984 LT/PIR WE 218867, 218357 DUE 9/14218867, 218357
25G# 202352 ZRX MED 4984 LT/PIR202352
Sheet23
Cell Formulas
RangeFormula
B14=IF(LEFT(A14,2)="G#",TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(MID(A14,3,255)),", ",",")," ",REPT(" ",100)),",",", "),"/",", "),50)),"")
C14=IF(ISNUMBER(SEARCH("WE",A14)),TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(A14,SEARCH("WE",A14)+3,255),", ",",")," ",REPT(" ",100)),",",", "),50)),"")
 
Upvote 0
Got your PM, that's because you have a SPACE Before And After the coma, you've never shown any sample where this happens, I'll adjust the formula for this, will post back.
 
Upvote 0
Here, this will handle SPACE COMA SPACE as well as COMA SPACE, and COMA only:


Excel 2010
ABC
1G# 202352, 202347 ZRX MED 4984 LT/PIR WE 218867 DUE 4/30202352, 202347218867
2G#222237/222240/222244 TUE 4911/4913/4940 PI/CFZ WE 220917 DUE 04/30222237, 222240, 222244220917
3G# 202352,202347 ZRX MED 4984 LT/PIR WE 218867, 218357 DUE 4/30202352, 202347218867, 218357
4G# 202352 ZRX MED 4984 LT/PIR WE 218867, 218357 DUE 9/14202352218867, 218357
5G# 202352, 202347 ZRX MED 4984 LT/PIR WE 218867 DUE 4/30202352, 202347218867
6Differ_GQQ02_02-10_IC_18-014_Due_12/25
7G#222237/222240/222244 TUE 4911/4913/4940 PI/CFZ WE 220917 DUE 04/30222237, 222240, 222244220917
8G# 202352,202347 ZRX MED 4984 LT/PIR WE 218867, 218357 DUE 4/30202352, 202347218867, 218357
92018 BS OCM WRT Carport -ZXR-94 VIFG54 *WATER* LO (JLK 2)
10G# 202352 ZRX MED 4984 LT/PIR WE 218867, 218357 DUE 9/14202352218867, 218357
11ZRX MED 4984 LT/PIR WE 218867, 218357 DUE 9/14218867, 218357
12G# 202352 ZRX MED 4984 LT/PIR202352
13G# 201872 , 201871 GH2 SK-452, 453, 454 LTR/ZPR INSPECTION LFIP WE 218765 , 218762 , 218770201872, 201871218765, 218762, 218770
14G# 205326 , 205166 FS1 MEDS 4910, 4911 LTR/ZPR INSPECTION EVERY SUNDAY205326, 205166
Sheet23
Cell Formulas
RangeFormula
B1=IF(LEFT(A1,2)="G#",TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(MID(A1,3,255))," , ",","),", ",",")," ",REPT(" ",100)),",",", "),"/",", "),50)),"")
C1=IF(ISNUMBER(SEARCH("WE",A1)),TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(A1,SEARCH("WE",A1)+3,255)," , ",","),", ",",")," ",REPT(" ",100)),",",", "),50)),"")
 
Upvote 0
You're welcome. Welcome to the forum BTW.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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