Formula to add zeros

TIFFSTER2001

Board Regular
Joined
Aug 23, 2004
Messages
71
Office Version
  1. 365
I have data that generates in this format T/12345/P0 that need to be turned into this format (T00025089P5), and always has 11 characters. The middle number (12345) is called the group. The group can be anywhere from 1-10000 but zeros need to be added before the group to get to the 11 characters as in this example, T00025089P5. What formula can be used to always create the 11 characters?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Try

Book3
ABC
1T/12345/P0T00012345P0
2
3
4
Sheet1
Cell Formulas
RangeFormula
B1B1=SUBSTITUTE(SUBSTITUTE(A1,"/",REPT(0,11-LEN(SUBSTITUTE(A1,"/",""))),1),"/","")
 
Upvote 0
Solution
@TIFFSTER2001 what version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
@TIFFSTER2001 what version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Thank you, I will do that.
 
Upvote 0

Forum statistics

Threads
1,214,891
Messages
6,122,101
Members
449,066
Latest member
Andyg666

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