C
Colin Hayes
Hi All
I need to add zeros to the beginning of numbers of less than 13 digits.
I've been using the custom format method 0000000000000 , but find it
'forgets' the zeros when counting the length of the cell contents. This
is causing errors.
I'm now using
=IF(LEN(A2)=12,("0"&A2),A2)
This correctly produces a cell which has a zero added when the length is
12 , and then correctly shows 13 digits when the length is queried.
Can someone suggest an amended formula to add 2 zeros when length is
11 , 3 zeros when length is 10 , 4 zeros when length is 9 and 5 zeroes
when length is 8?
Trying to work these into a single formula is beyond me , but I'm hoping
someone can help.
Grateful for any advice.
I need to add zeros to the beginning of numbers of less than 13 digits.
I've been using the custom format method 0000000000000 , but find it
'forgets' the zeros when counting the length of the cell contents. This
is causing errors.
I'm now using
=IF(LEN(A2)=12,("0"&A2),A2)
This correctly produces a cell which has a zero added when the length is
12 , and then correctly shows 13 digits when the length is queried.
Can someone suggest an amended formula to add 2 zeros when length is
11 , 3 zeros when length is 10 , 4 zeros when length is 9 and 5 zeroes
when length is 8?
Trying to work these into a single formula is beyond me , but I'm hoping
someone can help.
Grateful for any advice.