PC Review


Reply
Thread Tools Rate Thread

Adding a leading zero "0" to a number in a cell

 
 
chipwood3
Guest
Posts: n/a
 
      22nd Feb 2010
I am trying to create a formula that will add a leading zerto to any number
that comes in with less than 5 digits. This is for a spreadsheet that will
carry over zip codes for a mailing. I want to know if I can write a formula
and if so, what it is that if a column of numbers just has 234 that the
formula will automatically add the two zeros making it 00234. Or if it is
2345 it will convert it to 02345.

Also - will the leading zeros (for lack of a better term) be hard coded so
that when you extor to a csv or another format, the zeros will remain.

Thanks
--
Chip
 
Reply With Quote
 
 
 
 
B Lynn B
Guest
Posts: n/a
 
      22nd Feb 2010
supposing your 234 value is in cell A1, your formula would be:
=TEXT(A1,"00000")

Yes, these will be sustained through saving as CSV or other format, as they
are now a text value.

"chipwood3" wrote:

> I am trying to create a formula that will add a leading zerto to any number
> that comes in with less than 5 digits. This is for a spreadsheet that will
> carry over zip codes for a mailing. I want to know if I can write a formula
> and if so, what it is that if a column of numbers just has 234 that the
> formula will automatically add the two zeros making it 00234. Or if it is
> 2345 it will convert it to 02345.
>
> Also - will the leading zeros (for lack of a better term) be hard coded so
> that when you extor to a csv or another format, the zeros will remain.
>
> Thanks
> --
> Chip

 
Reply With Quote
 
OssieMac
Guest
Posts: n/a
 
      22nd Feb 2010
Select Number format then Number then Custom. Inset 5 zeros in the Type: Field.

I tested this in xl2007. Saving as a .csv file and then opened it with
Notepad and the leading zeros were there.



--
Regards,

OssieMac


"chipwood3" wrote:

> I am trying to create a formula that will add a leading zerto to any number
> that comes in with less than 5 digits. This is for a spreadsheet that will
> carry over zip codes for a mailing. I want to know if I can write a formula
> and if so, what it is that if a column of numbers just has 234 that the
> formula will automatically add the two zeros making it 00234. Or if it is
> 2345 it will convert it to 02345.
>
> Also - will the leading zeros (for lack of a better term) be hard coded so
> that when you extor to a csv or another format, the zeros will remain.
>
> Thanks
> --
> Chip

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding data only if adjacent to cell labeled "male"/"female" lovesrubbaducky Microsoft Excel Worksheet Functions 1 23rd Nov 2009 05:49 PM
Adding "0" as leading digits into cells in Excel =?Utf-8?B?VGlwcGV0dWU=?= Microsoft Excel Worksheet Functions 2 19th Oct 2006 12:14 AM
how do I eliminate leading "0s" in an alpha numeric cell =?Utf-8?B?UkVTVA==?= Microsoft Excel Misc 1 14th Sep 2006 01:35 AM
Is it possible to show leading zeros for "number" cells? =?Utf-8?B?Q29sdW1idXMgRXhjZWwgVXNlcg==?= Microsoft Excel Misc 1 21st Jul 2005 06:19 PM
adding leading "0" to text field carol Microsoft Access Queries 9 31st Dec 2003 03:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:41 AM.