Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 90
Default How do I format a field in Excel to allow for leading zeros?

I am creating an Excel Document that has certain values that must have
leading zeros. Does anyone know how to allow leading zeros in Excel?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How do I format a field in Excel to allow for leading zeros?

You have a few options.

If you want to treat the value as text:
#1. Preformat the cell as Text (format|cells|Number tab|Text)
(then do the data entry)
#2. Prefix your entry with an apostrophe: '0012345

If you want to treat the value as a number:
#1. Give the cell a custom format like:
Format|cells|number tab|Custom category|000000
(to show 6 digits--including leading digits if required)

debbie wrote:

I am creating an Excel Document that has certain values that must have
leading zeros. Does anyone know how to allow leading zeros in Excel?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default How do I format a field in Excel to allow for leading zeros?

Use a number format like 0000, with one zero per digit. For example, a zip
code requires a number format of 00000 or 00000-0000.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"debbie" wrote in message
...
I am creating an Excel Document that has certain values that must have
leading zeros. Does anyone know how to allow leading zeros in Excel?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default How do I format a field in Excel to allow for leading zeros?

You can either use a custom NUMBER format if the length of all entries will
be the same.

For example: Custom format 00000

Then:

1 becomes 00001
12 becomes 00012
123 becomes 00123
1234 becomes 01234
12345 stays 12345

However, using this method Excel will still not recognize the leading 0's.
00001 has a true underlying value of 1.

Or, you can preformat the cells as TEXT.

Or, you can precede the entry with an apostrophe as you enter them: '00001.
This also results in a TEXT entry.

Biff

"debbie" wrote in message
...
I am creating an Excel Document that has certain values that must have
leading zeros. Does anyone know how to allow leading zeros in Excel?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
leading zeros in text format BigBrook Excel Discussion (Misc queries) 5 December 11th 08 08:00 PM
How do I keep leading zeros and format my cells as text? BlabberLots Excel Discussion (Misc queries) 1 February 9th 07 06:29 PM
hyphenated number format with leading zeros to the right of the hy CJ Excel Discussion (Misc queries) 4 November 17th 05 02:18 PM
Format a cell to keep leading zeros. Shadyhosta New Users to Excel 5 July 27th 05 04:37 PM
save text field w/ leading zeros in .csv format & not lose zeros? Ques Excel Discussion (Misc queries) 1 May 4th 05 06:21 PM


All times are GMT +1. The time now is 05:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"