add 1 leading zero if missing from a text

  • Thread starter Thread starter Kemi
  • Start date Start date
K

Kemi

I would like to add a leading zero to each text in a column IF the
text does not already have a leading zero. Can anyone please tell me
how to do this?

Thank you.


Kemi
 
You can use a "helper" column to accomplish this.
If data starts in A1, enter this (for example) in B1:

=IF(LEFT(A1)<>"0","0"&A1,A1)

And copy down as needed.

You can then delete the original Column if you wish.
 
Actually, if you DID delete the original column, you'd end up with errors.

I should have mentioned that *before* you delete the original column, you
should remove the formulas that performed the change, leaving behind only
the transformed data, and *then* you can delete the original column.

After you have dragged down to copy the formula, while the cells are still
selected, right click in the selection and choose <Copy>.
Right click again and choose "PasteSpecial".
Click on "Values", then <OK>.

Your "helper" column now contains only data, allowing you to delete the
original column if you wish.
 
Back
Top