Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - Add a leading zero to CSV file 1

Status
Not open for further replies.

jhruby

IS-IT--Management
Sep 27, 2002
23
US
Does anyone have a formula that will help me add a leading zero to a number in a CSV file? Example: my number is 8823 and I need it to be 08823. Any help would be appreciated.
 
you must add the leading zero in the excel file, AFTER setting the column's format to TEXT., Once you have done that, it should work

Rgds, Geoff

"Having been erased. the document thjat you are seeking. Must now be retyped"

Please read FAQ222-2244 before you ask a question
 
Assuming you want you want your number to be 6 characters long:
=RIGHT(REPT("0",6)&A1,6)

Change the 6s to the number of characters you want your results.


Mike
 
In Excel, you can highlight the column, then Format Cells, then under Number tab, go to Custom and put in 6 zeros in "Type In" That should work.
 
AlsGal52 - that would not work for export to CSV

Rgds, Geoff

"Having been erased. the document thjat you are seeking. Must now be retyped"

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top