Eg:
=RIGHT("00000" & A1, 5)
Or:
=RIGHT(REPT("0",5) & A1, 5)
Adjust the 5
to the total padded length you want.
Frage
I made the mistake a while back of stripping the leading zeros off of some data that I know has a length of n digits. I have filtered for only those with less than n digits, and there are variable lengths. Is there a way to use the REPLACE function or something else to account for the fact that I want to keep adding zeros to these filtered cells until the length becomes n?
EDIT: My current function is simply
=IF(LEN(K2)=n-1,CONCATENATE(0,K2),IF(LEN(K2)=n-2,CONCATENATE(0,0,K2),IF(LEN(K2)=n-3,CONCATENATE(0,0,0,K2),....,"")))
but I imagine there must be a more efficient formula.
Lösung
Eg:
=RIGHT("00000" & A1, 5)
Or:
=RIGHT(REPT("0",5) & A1, 5)
Adjust the 5
to the total padded length you want.
Andere Tipps
If all the number in the column are the same length you could do custom formatting = 0000000 with the number of 0's you need.