Remove text and then trim remainder from excel cell

itsmythg

New Member
Joined
Sep 15, 2016
Messages
4
I have a file with cells containing 9932/0009 i need to convert this to 320009 so what needs to happen is remove the "/" then remove first 2 characters (99) leaving me 320009. I figured out =SUBSTITUTE(D3,"/","") (with the help of this site) and to use =RIGHT(G4,(6)) to get the right results but i was hoping to combine into one step to simplify process.

Thanks for your help.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
One more question it is removing the 00 i need the field to maintain the 6 characters because the data i'm validating has the 00 and it fails the query if it doesn't.
 
Upvote 0
It shouldn't be removing the 00 from the sample you gave because it's in the middle. I'm assuming your talking about a different example. Does this fix your problem?

=TEXT(RIGHT(SUBSTITUTE(D3,"/",""),6),"000000")
 
Upvote 0
It shouldn't be removing the 00 from the sample you gave because it's in the middle. I'm assuming your talking about a different example. Does this fix your problem?

=TEXT(RIGHT(SUBSTITUTE(D3,"/",""),6),"000000")
You should not need the TEXT function call... just removing the +0 from your original formula should be good enough...

=RIGHT(SUBSTITUTE(D3,"/",""),6)

Assuming there are always four digits in front of the slash, here is an alternate that should also work...

=REPLACE(A1,1,5,MID(A1,3,2))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,086
Messages
6,128,734
Members
449,466
Latest member
Peter Juhnke

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