ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I format a field in Excel to allow for leading zeros? (https://www.excelbanter.com/excel-discussion-misc-queries/139037-how-do-i-format-field-excel-allow-leading-zeros.html)

Debbie

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?

Dave Peterson

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

Jon Peltier

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?




T. Valko

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?





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com