Removing Zeros in the middle of a drawing number

Fola

New Member
Joined
Nov 16, 2023
Messages
6
Office Version
  1. 365
Platform
  1. Web
Hi All, how do I remove the zeros after the second "- " of my drawing numbers? Thanks

ST0042-E8020-0373 to be ST0042-E8020-373
ST0042-E9006-0021 to be ST0042-E9006-21
ST0041-E8060-0001 to be ST0042-E8060-1

Can I have a single formula to fix this? Thanks.
 
The numbers you're providing now are not like your original sample:

ST0042-E8020-0373 to be ST0042-E8020-373
ST0042-E9006-0021 to be ST0042-E9006-21
ST0041-E8060-0001 to be ST0042-E8060-1

Your numbers had 3 blocks with a 4 digit number at the end.

Now, you're providing different style numbers.
 
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
=TEXTBEFORE(A1,"-",-1)&TEXT(TEXTAFTER(A1,"-",-1),"-0")
Perhaps I am not understanding what the latest sample data is like but is the TEXT() function actually required?
Would this do the same job?
=TEXTBEFORE(A1,"-",-1)&-TEXTAFTER(A1,"-",-1)
 
Upvote 0
That's clever adding a negative number to the end to strip out the leading zeros. The only thing mine will do that those don't is if it's a single ending 0, my formula will keep it.

ST0042-E8020-0

but I don't know if that's actually a possibility or not.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,959
Members
449,096
Latest member
Anshu121

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