Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 90219

How to prepend zeros to text until certain length

$
0
0

I have a column that looks like this '12345' and another column that tells this number's length.
I need to add leading zeros to it until length in another column. Values in length column are either 8 or 6. If number in this column is less than 6 or 8 then add zeros until it becomes that length. I tried this but this isn't working:

=TEXT(H2,"0000000")

Data:
enter image description here

Edit: output

"033328" or "00009971"


Viewing all articles
Browse latest Browse all 90219

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>