Custom Format
Custom Format
Number Code
0 (zero) Digit placeholder. This code pads the value with zeros to fill the format.
? Digit placeholder. This code leaves a space for insignificant zeros but
does not display them.
E+ E- e+ e- Scientific notation.
$ - + / ( ) : space These characters are displayed in the number. To display any other
character, enclose the character in quotation marks or precede it with a
backslash.
* This code repeats the next character in the format to fill the column
width.
_ (underscore) This code skips the width of the next character. This code is commonly
used as "_)" (without the quotation marks) to leave space for a closing
Page 1
parenthesis in a positive number format when the negative number
format includes parentheses. This allows the values to line up at the
decimal point.
@ Text placeholder.
Page 2
Miscellaneous Description
Code
[BLACK], [BLUE], These codes display the characters in the specified colors.
[CYAN], [GREEN],
[MAGENTA], Note n is a value from 1 to 56 and refers to the nth color in the color
[RED], [WHITE], palette.
[YELLOW],
[COLOR n]
[Condition value] Condition may be <, >, =, >=, <=, <> and value may be any number.
Clear presentation of numerical and logical information in Excel is fundamental when you want to
improve usability of your financial models. Custom number formats in Excel is critical to good
presentation.
This Tutorial outlines different key techniques which can be quickly applied to any project
finance model, and is recommended for Excel users at all levels.
Excel often formats numbers as it sees fit, for example, if the user types in 10%, Excel will
automatically format this cell as a percentage and any future values entered into this cell will
be formatted similarly. To custom format a cell click on the target cell then go to Format -
> Cells (the shortcut is Ctrl+1). The Format Cells window should look like this:
Page 3
How to Set Custom Number Formats in Excel
To set custom formats click on “Custom” in the Category.
Page 4
The custom format is entered under Type. Excel allows for four (4) format sections:
Each section needs to be separated by a semi colon “;”. 0 represents where the numbers
should appear, for example to display 2 d.p. “0.00” is used and for no d.p. “0” will suffice.
To use commas as separators “0,000” is required. Only the Positive section is mandatory by
Excel. By omitting all of the other sections Excel will assume the positive format. If however
the user wishes to customize the zero section, all sections prior, i.e. Positive and Negative
sections must be specified or empty cells will be displayed for the value corresponding to the
omitted section.
Page 5
Here the format is quite similar to 2 d.p. but with “.00” removed to represent zero d.p.
Combining Text and Numbers in a custom format
Type is written as: For Op Qtr 1 – “Op Qtr” 0, and for 5.25 yrs – “0.00” yrs
To combine text and number the text portion must be enclosed by double apostrophes.
Negative, Zero and Text sections are omitted.
Ratios
Type is written as: 0.00“x”
This is another example of combining text and number however in this case there is no space
between 0.00 and “x” as x should follow immediately after the number.
Percentages with 0% Displayed as “-”
Type is written as: 0%; -0%; -
Since the zero section is customised, both Positive and Negative sections must be specified
as well.
Displaying 1 and 0 as “Yes” and “No”
Type is written as: “Yes”; ; “No”
Because 1 is a positive number only the Positive and Zero sections need be defined. Any
positive number will return “Yes” but if a negative value is entered the cell will remain empty
as the Negative section is undefined.
To demonstrate the custom number formats in the above examples, we have put in a sample
workbook. To view the number formats in certain cell, click on the cell then go to Format ->
Cells -> Number -> Custom.
The format cells in the above examples are as illustrated in the screenshot below.
Page 6
Advanced Custom Number Formatting
If you want to explore more advanced features of the custom formatting in Excel, look into the
following features
Actually, we can for format a selection and show all negative numbers as zero. You can do it
with following steps:
Step 1: Select the range that you will work with, in this case it's A1:E12.
Step 2: Right click the selection, and select the Format Cell item from the context menu.
Page 7
Select the Custom in the category box;
In the type: box, enter the #,##0;"0" , see the following screen shot
Page 8
beginning of the section)
() Negative values in brackets
"" Custom text, for example, "lbs" or "zero"
@ Text as entered (only applies to the last formatting
section)
Page 9