Skip to main content

I have a column named MIN and need to add leading zeros when the value in column is less than 4 numbers:

BeforeAfter Formula
220022
4560456
1000010000
8888888888
999999999999999999

This is what I have right now but is giving me an error for the largest number:

IF((COUNT(MIN) <= 3), (REPT('0',4 - LEN({MIN} &''))&{MIN}), {MIN}))

Change the "COUNT" to a "LEN" and it should work fine:

IF((LEN(MIN) <= 3), (REPT('0',4 - LEN({MIN} &''))&{MIN}), {MIN})

Change the "COUNT" to a "LEN" and it should work fine:

IF((LEN(MIN) <= 3), (REPT('0',4 - LEN({MIN} &''))&{MIN}), {MIN})

That didn't work for me and am now getting an error message in the column cells, the value is a number, will LEN work with that?


That didn't work for me and am now getting an error message in the column cells, the value is a number, will LEN work with that?


Try adding a ` & ""` to your initial LEN(), the same way you're handling your second LEN()

IF((LEN(MIN & "") <= 3), (REPT('0',4 - LEN({MIN} & ''))&{MIN}), {MIN})


Reply