Custom formatted cell with leading zeros not carrying over to CONCATENATE

mjaeger1

New Member
Joined
Jul 1, 2018
Messages
26
Hi All,

I have a quoting tool im working on and hitting a snag.

I was forced to use custom formatting on my 'Length' column so that I could use a =IF formula on the 'breakout' column to automatically populate that cell depending on the value entered in 'length'.

"length' must have leading zeros to make it a 2 digit number (in this case it is one leading zero in the first case (01, 05, 08, 10, 15), and four leading zeros in the second (0001, 0006, 0010, 0120)

The issue is that when i try to use a =concatenate function, it does not carry to leading zeros.

Is there any way to get around this without using a =text function, as there is not always a set number of leading zeros depending on the value?

NBC Fiber QuickQuote - Final - V 1.3 DL.xlsm
CDEFGHIJKLMNO
29Multimode (OM4)Length in Meters (2 digit i.e. 02, 07, 10, 10.5)Breakout
30Side ASide BBase Part Number (xx-Length, yy-Breakout, p-Polarity)
31MPOLC/UPC 2-strandSFH-FH002MRSFH-FH002MRxxMyyKM0132#N/AKMSFH-FH002MR01M32K
32MPOLC/UPC 4-strandSFH-FH004MRSFH-FH004MRxxMyyKM0118#N/AKM 
33MPOLC/UPC 8-strandSFH-FH008MRSFH-FH008MRxxMyyKM1032#N/AKM 
34Side ASide BBase Part Number (xx-Length, yy-Breakout, p-Polarity)Length in (M) (4 digit)Breakout
35MPO 12F (Female Low Loss) S542LL-MPO - 12F (Female Low Loss)S542LL-S542LL-BxxxxM#N/A000432#N/AM 
Fiber Quick Quote Tool
Cell Formulas
RangeFormula
K31K31=IF(I31>=3,"32",IF(I31<3,"18",IF(I31="","")))
L31:L33L31=VLOOKUP(K31,'VLookup PN Generator'!$F$110:$G$112,2,FALSE)
K32:K33,K35K32=IF(I32>=3,"32",IF(I32<3,"18"))
O31O31=IFERROR(CONCATENATE(F31,I31,N31,K31,M31),"")
O32:O33O32=IFERROR(CONCATENATE(F32,I32,H32,L32,M32),"")
D35D35=F35
H35H35=IF(LEN(VLOOKUP(G35,'VLookup PN Generator'!$C$189:$D$190,2,0))=0,"",VLOOKUP(G35,'VLookup PN Generator'!$C$189:$D$190,2,0))
L35L35=VLOOKUP(K35,'VLookup PN Generator'!$C$178:$D$180,2,FALSE)
O35O35=IFERROR(CONCATENATE(F35,L35,I35,N35),"")
 
I'm not saying you have to format it as text, I'm saying you need to change the formula I suggested depending on whether it should be 2 or 4 digits.
 
Upvote 0

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
The formula that kelliot suggested will not add the leading zeros. You have to do that in the formula as I showed.
 
Upvote 0
Hi,

What determines if it's 2 or 4 digits?

It will depend upon the item row. Its different for each part variation (one per row). Each row will have a set number of digits. These digits are the "length"

Since the 2 digit and 4 digit cells are Custom Formatted with leading 0 (zero) to fill the # of digits, perhaps if you Explain what rule(s) determine how you custom format the cell to either 2 or 4 digits will help in structuring a formula for your needs. Obviously, the cells didn't get the custom format by themselves, so your Must have something to go by.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

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