remove character before middle and after and replace some values & delete specific columns

abdelfattah

Well-known Member
Joined
May 3, 2019
Messages
1,429
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
hi
I need delete specific columns with remove some characters before numbers and letters the middles for instance BS 1200R20 G580 TCF the meddle should be 1200R20 the spaces are one then should delete BS ,G580, TCF and some columns and replace the values in COL O are matched with COL J then should replace COL R for in COL J I know this is not clear I face difficulty to explain clearly if any body see my post is not clear please inform me what I have to explain to understand my post
the original data
(3).xlsx
ABCDEFGHIJKLMNOPQR
1costpurpricepackprpwkntypeoriginqtyNMBRANDnmitem
2178.572841,500.00pack740N/ABRIDGESTONEG580JAPAN50inv1BS 1200R20 G580 TCFinv11origintyp
3272.95272.951,400.00pack412.91N/ABRIDGESTONEG580THAILAND179inv2BS 1200R20 G580 THAinv22JAPANJAP
4282.142811,370.00pack385.57N/ABRIDGESTONER187JAPAN835inv3BS 1200R20 R187 TCFinv33THAILANDTHI
5257.65252.351,270.00pack392.92N/ABRIDGESTONER187THAILAND167inv4BS 1200R20 R187 THAinv44INDONESIAIND
6343.54337.841,750.00pack409.4N/ABRIDGESTONEG580JAPAN164inv5BS 1200R24 G580inv55POLANDPOL
7283.9278.11,425.00pack401.93N/ABRIDGESTONER187JAPAN70inv6BS 13R22.5 R187inv66INDIAINDI
8466.08458.350pack-100N/ABRIDGESTONER180JAPAN103inv7BS 1400R20 TCF R180inv77CHINACHI
935.67350pack-100N/ABRIDGESTONER623JAPAN100inv8BS 155R12C R623inv88
1034.6534.65155pack347.33N/ABRIDGESTONER624INDONESIA185inv9BS 155R12C R624inv99
1140.9540.95185pack351.77N/ABRIDGESTONER624INDONESIA52inv10BS 165R13C R624inv1010
1229.429.4125pack325.17N/ABRIDGESTONEEP150INDONESIA247inv11BS 175/65R14 EP150inv1111
1327.8127.81125pack349.48N/ABRIDGESTONEEP150THAILAND42inv12BS 175/70R13 EP150inv1212
1430.1930.45133pack340.54N/ABRIDGESTONEEP150THAILAND239inv13BS 175/70R14 EP150inv1313
1553.82120135pack150.84N/ABRIDGESTONERLINDONESIA755inv14FS 1600-25 RLinv1414
1631.4231.42135pack329.73N/ABRIDGESTONEVRLSTHAILAND331inv15OL 2400R35 ** VRLSinv1515
1735.0235.020pack-100N/ABRIDGESTONE**VUTJAPAN60inv16BS 20.5R25 ** VUTinv1616
18
sheet1



expected result
(3).xlsx
ABCDE
1itemBRANDtypeoriginqty
21 1200R20 G580JAP50
32 1200R20 G580THI179
43 1200R20R187JAP835
54 1200R20 R187THI167
65 1200R24 G580JAP164
76 13 R22.5 R187JAP70
87 1400R20 R180JAP103
98 155 R12C R623JAP100
109 155 R12C R624INDO185
1110 165 R13C R624INDO52
1211 175/65 R14 EP150INDO247
1312 175/70 R13 EP150THI42
1413 175/70 R14 EP150THI239
15141600-25 RLINDO755
16152400R35VRLSTHI331
1716 20.5R25**VUTJAP60
result

about the stars showing are short word JAPAN but i no know why show stars
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
@abdelfattah

Does this formula approach help?

Cell Formulas
RangeFormula
A2:A18A2=Sheet1!P2
B2:B18B2=TRIM(MID(SUBSTITUTE(Sheet1!N2," ",REPT(" ",99)),99,99))
C2:C18,E2:E18C2=Sheet1!J2
D2:D18D2=IFERROR(INDEX(Sheet1!$S$2:$S$8,MATCH(Sheet1!K2,Sheet1!$R$2:$R$8,0),),"")
 
Upvote 0
thanks I think made mistake about row 16 like row 17 when show the result
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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