Custom Format Codes Reference
Custom Format Codes Reference
The default format in Excel is General. General format are displayed just
the way you type them. However, if the cell is not wide enough to show
the entire number, the General format rounds the numbers with
decimals.
Some characters appear normally in a number format, while others
require special handling. The following characters can be be used without
any special handling(use of escape character \):
FORMAT CODE SECTIONS
EXCEL FORMATTING RULES:
1. A custom Excel number format changes only the visual representation, i.e. how
a value is displayed in a cell. The underlying value stored in a cell is not changed.
2. When you are customizing a built-in Excel format, a copy of that format is
created. The original number format cannot be changed or deleted.
3. Excel custom number format does not have to include all four sections.
If a custom format contains just 1 section, that format will be applied to all
number types - positive, negative and zeros.
4. If a custom number format includes 2 sections, the first section is used for
positive numbers and zeros, and the second section - for negative numbers.
5. A custom format is applied to text values only if it contains all four sections.
6. To apply the default Excel number format for any of the middle sections, type
General instead of the corresponding format code.
For example, to display zeros as dashes and show all other values with the default
formatting, use this format code: General; -General; "-"; General
Note. The General format included in the 2nd section of the format code does not
display the minus sign, therefore we include it in the format code.
7. To hide a certain value type(s), skip the corresponding code section, and only
type the ending semicolon.
For example, to hide zeros and negative values, use the following format code:
General; ; ; General. As the result, zeros and negative value will appear only in the
formula bar, but will not be visible in cells.
In this system:
• 2 is 2-Jan-1900
• 3 is 3-Jan-1900
• 42005 is 1-Jan-2015 (because it is 42,005 days after January 1, 1900)
TIME IN EXCEL
Times are stored in Excel as decimals, between .0 and .99999, that represent a
proportion of the day where .0 is 00:00:00 and .99999 is 23:59:59.
For example:
0.25 is 06:00 AM
0.5 is 12:00 PM
0.541655093 is 12:59:59 PM
For example: