Extract and replace particular character in a cell

DQ2013

New Member
Joined
Nov 7, 2013
Messages
31
HI
Please help me with the following.
I have the following data as "SKU" I require a formula to look for "ORG" and replace as "ORA" . I cannot use the find and replace as the data is live dump hence require a formula.

[TABLE="width: 320"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]SKU[/TD]
[TD]require the following[/TD]
[/TR]
[TR]
[TD]1570T1-ORG-R087[/TD]
[TD]1570T1-ORA-R087[/TD]
[/TR]
[TR]
[TD]1570T1-ORG-R092[/TD]
[TD]1570T1-ORA-R092[/TD]
[/TR]
[TR]
[TD]1570T1-ORG-R097[/TD]
[TD]1570T1-ORA-R097[/TD]
[/TR]
[TR]
[TD]1570T1-ORG-R102[/TD]
[TD]1570T1-ORA-R102[/TD]
[/TR]
[TR]
[TD]1570T1-ORA-R087[/TD]
[TD]1570T1-ORA-R087[/TD]
[/TR]
[TR]
[TD]1570T1-ORA-R092[/TD]
[TD]1570T1-ORA-R092[/TD]
[/TR]
[TR]
[TD]1570T1-ORA-R097[/TD]
[TD]1570T1-ORA-R097[/TD]
[/TR]
[TR]
[TD]1570T1-ORA-R102[/TD]
[TD]1570T1-ORA-R102[/TD]
[/TR]
[TR]
[TD]1500T1-ORG-DM[/TD]
[TD]1500T1-ORA-DM[/TD]
[/TR]
[TR]
[TD]1500T1-ORG-EL[/TD]
[TD]1500T1-ORA-EL[/TD]
[/TR]
[TR]
[TD]1500T1-ORG-FXL[/TD]
[TD]1500T1-ORA-FXL[/TD]
[/TR]
[TR]
[TD]1500T1-ORG-G2XL[/TD]
[TD]1500T1-ORA-G2XL[/TD]
[/TR]
[TR]
[TD]1500T1-ORG-G3XL[/TD]
[TD]1500T1-ORA-G3XL[/TD]
[/TR]
[TR]
[TD]1500T1-ORG-G4XL[/TD]
[TD]1500T1-ORA-G4XL[/TD]
[/TR]
[TR]
[TD]1500T1-ORG-G5XL[/TD]
[TD]1500T1-ORA-G5XL[/TD]
[/TR]
[TR]
[TD]1500T1-ORA-CS[/TD]
[TD]1500T1-ORA-CS[/TD]
[/TR]
[TR]
[TD]1500T1-ORA-DM[/TD]
[TD]1500T1-ORA-DM[/TD]
[/TR]
[TR]
[TD]1500T1-ORA-EL[/TD]
[TD]1500T1-ORA-EL[/TD]
[/TR]
[TR]
[TD]1500T1-ORA-FXL[/TD]
[TD]1500T1-ORA-FXL[/TD]
[/TR]
[TR]
[TD]1500T1-ORA-G2XL[/TD]
[TD]1500T1-ORA-G2XL[/TD]
[/TR]
[TR]
[TD]1500T1-ORA-G3XL[/TD]
[TD]1500T1-ORA-G3XL[/TD]
[/TR]
[TR]
[TD]1500T1-ORA-G4XL[/TD]
[TD]1500T1-ORA-G4XL[/TD]
[/TR]
[TR]
[TD]1500T1-ORA-G5XL[/TD]
[TD]1500T1-ORA-G5XL[/TD]
[/TR]
</tbody>[/TABLE]

Thanks and regards,
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
with PowerQuery

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table8"]}[Content],
    #"Replaced Value" = Table.ReplaceValue(Source,"ORG","ORA",Replacer.ReplaceText,{"SKU"})
in
    #"Replaced Value"[/SIZE]

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#5B9BD5]SKU[/td][td][/td][td=bgcolor:#70AD47]SKU[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]1570T1-ORG-R087[/td][td][/td][td=bgcolor:#E2EFDA]1570T1-ORA-R087[/td][/tr]

[tr=bgcolor:#FFFFFF][td]1570T1-ORG-R092[/td][td][/td][td]1570T1-ORA-R092[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]1570T1-ORG-R097[/td][td][/td][td=bgcolor:#E2EFDA]1570T1-ORA-R097[/td][/tr]

[tr=bgcolor:#FFFFFF][td]1570T1-ORG-R102[/td][td][/td][td]1570T1-ORA-R102[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]1570T1-ORA-R087[/td][td][/td][td=bgcolor:#E2EFDA]1570T1-ORA-R087[/td][/tr]

[tr=bgcolor:#FFFFFF][td]1570T1-ORA-R092[/td][td][/td][td]1570T1-ORA-R092[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]1570T1-ORA-R097[/td][td][/td][td=bgcolor:#E2EFDA]1570T1-ORA-R097[/td][/tr]

[tr=bgcolor:#FFFFFF][td]1570T1-ORA-R102[/td][td][/td][td]1570T1-ORA-R102[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]1500T1-ORG-DM[/td][td][/td][td=bgcolor:#E2EFDA]1500T1-ORA-DM[/td][/tr]

[tr=bgcolor:#FFFFFF][td]1500T1-ORG-EL[/td][td][/td][td]1500T1-ORA-EL[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]1500T1-ORG-FXL[/td][td][/td][td=bgcolor:#E2EFDA]1500T1-ORA-FXL[/td][/tr]

[tr=bgcolor:#FFFFFF][td]1500T1-ORG-G2XL[/td][td][/td][td]1500T1-ORA-G2XL[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]1500T1-ORG-G3XL[/td][td][/td][td=bgcolor:#E2EFDA]1500T1-ORA-G3XL[/td][/tr]

[tr=bgcolor:#FFFFFF][td]1500T1-ORG-G4XL[/td][td][/td][td]1500T1-ORA-G4XL[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]1500T1-ORG-G5XL[/td][td][/td][td=bgcolor:#E2EFDA]1500T1-ORA-G5XL[/td][/tr]

[tr=bgcolor:#FFFFFF][td]1500T1-ORA-CS[/td][td][/td][td]1500T1-ORA-CS[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]1500T1-ORA-DM[/td][td][/td][td=bgcolor:#E2EFDA]1500T1-ORA-DM[/td][/tr]

[tr=bgcolor:#FFFFFF][td]1500T1-ORA-EL[/td][td][/td][td]1500T1-ORA-EL[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]1500T1-ORA-FXL[/td][td][/td][td=bgcolor:#E2EFDA]1500T1-ORA-FXL[/td][/tr]

[tr=bgcolor:#FFFFFF][td]1500T1-ORA-G2XL[/td][td][/td][td]1500T1-ORA-G2XL[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]1500T1-ORA-G3XL[/td][td][/td][td=bgcolor:#E2EFDA]1500T1-ORA-G3XL[/td][/tr]

[tr=bgcolor:#FFFFFF][td]1500T1-ORA-G4XL[/td][td][/td][td]1500T1-ORA-G4XL[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]1500T1-ORA-G5XL[/td][td][/td][td=bgcolor:#E2EFDA]1500T1-ORA-G5XL[/td][/tr]
[/table]

after any changes:Ctrl+Alt+F5
 
Upvote 0
HI Sandy,

Thanks for your help, understand this is macro , is there a way to have formula instead of macro.

Thanks and regards,
Drren
 
Upvote 0
Hi,

Formula copied down:


Book1
AB
1SKU
21570T1-ORG-R0871570T1-ORA-R087
31570T1-ORG-R0921570T1-ORA-R092
41570T1-ORG-R0971570T1-ORA-R097
51570T1-ORG-R1021570T1-ORA-R102
61570T1-ORA-R0871570T1-ORA-R087
71570T1-ORA-R0921570T1-ORA-R092
81570T1-ORA-R0971570T1-ORA-R097
91570T1-ORA-R1021570T1-ORA-R102
101500T1-ORG-DM1500T1-ORA-DM
111500T1-ORG-EL1500T1-ORA-EL
121500T1-ORG-FXL1500T1-ORA-FXL
131500T1-ORG-G2XL1500T1-ORA-G2XL
141500T1-ORG-G3XL1500T1-ORA-G3XL
151500T1-ORG-G4XL1500T1-ORA-G4XL
161500T1-ORG-G5XL1500T1-ORA-G5XL
171500T1-ORA-CS1500T1-ORA-CS
181500T1-ORA-DM1500T1-ORA-DM
191500T1-ORA-EL1500T1-ORA-EL
201500T1-ORA-FXL1500T1-ORA-FXL
211500T1-ORA-G2XL1500T1-ORA-G2XL
221500T1-ORA-G3XL1500T1-ORA-G3XL
231500T1-ORA-G4XL1500T1-ORA-G4XL
241500T1-ORA-G5XL1500T1-ORA-G5XL
Sheet307
Cell Formulas
RangeFormula
B2=SUBSTITUTE(A2,"ORG","ORA")
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
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