0% found this document useful (0 votes)
303 views9 pages

Custom Format

This document outlines different number formatting codes that can be used in Excel to customize the display of values. It provides descriptions and examples of codes for general number formatting, text formatting, date formatting, time formatting, and other miscellaneous codes for colors and conditions. Examples are given that demonstrate how to use custom number formats to display numbers with commas, different decimal places, percentages, and combining text and numbers. Advanced features covered include changing negative numbers to zero and formatting cells based on cell values.

Uploaded by

Rohit_MCTS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
303 views9 pages

Custom Format

This document outlines different number formatting codes that can be used in Excel to customize the display of values. It provides descriptions and examples of codes for general number formatting, text formatting, date formatting, time formatting, and other miscellaneous codes for colors and conditions. Examples are given that demonstrate how to use custom number formats to display numbers with commas, different decimal places, percentages, and combining text and numbers. Advanced features covered include changing negative numbers to zero and formatting cells based on cell values.

Uploaded by

Rohit_MCTS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Description

Number Code

General General number format.

0 (zero) Digit placeholder. This code pads the value with zeros to fill the format.

# Digit placeholder. This code does not display extra zeros.

? Digit placeholder. This code leaves a space for insignificant zeros but
does not display them.

. (period) Decimal number.

% Percentage. Microsoft Excel multiplies by 100 and adds the % character.

, (comma) Thousands separator. A comma followed by a placeholder scales the


number by a thousand.

E+ E- e+ e- Scientific notation.

Text Code Description

$ - + / ( ) : 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.

\character This code displays the character you specify.

Note Typing !, ^, &, ', ~, {, }, =, <, or > automatically places a backslash


in front of the character.

"text" This code displays text.

* This code repeats the next character in the format to fill the column
width.

Note Only one asterisk per section of a format is allowed.

_ (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.

Date Code Description

m Month as a number without leading zeros (1-12)

mm Month as a number with leading zeros (01-12)

mmm Month as an abbreviation (Jan - Dec)

mmmm Unabbreviated Month (January - December)

d Day without leading zeros (1-31)

dd Day with leading zeros (01-31)

ddd Week day as an abbreviation (Sun - Sat)

dddd Unabbreviated week day (Sunday - Saturday)

yy Year as a two-digit number (for example, 96)

yyyy Year as a four-digit number (for example, 1996)

Time Code Description

h Hours as a number without leading zeros (0-23)

hh Hours as a number with leading zeros (00-23)

m Minutes as a number without leading zeros (0-59)

mm Minutes as a number with leading zeros (00-59)

s Seconds as a number without leading zeros (0-59)

ss Seconds as a number with leading zeros (00-59)

AM/PM am/pm Time based on the twelve-hour clock

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.

Note A number format may contain up to two conditions.

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:

0.00 ; (0.00) ; 0.00 ; “Text “@


(Positive) (Negative) (Zero) (Text)

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.

Examples of custom formats in Excel


Comma with 2 Decimal Places
Type is written as: 0,000.00; (0,000.00);
The format represents 2 d.p. for positive values with comma separators (“0,000.00”), 2 d.p.
enclosed in brackets for negative numbers with comma separators (“(0.00)”) and zero
displayed as a dash (“-”)
Comma with No Decimal Places
Type is written as: 0,000; (0,000); -

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

Change negative number to zero with custom Format Cell

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.

Step 3: In the Format Cells dialog box,

 Click Number tab;

Page 7
 Select the Custom in the category box;
 In the type: box, enter the #,##0;"0" , see the following screen shot

The pound currency symbol


# A digit if entered, left blank if no digit entered
, Commas between thousands and millions
0 A zero if no digit entered (useful for leading and
trailing zeros)
_ (underscore) A space the width of the next character
[Red] Font colour for the section (Must be placed at the

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

You might also like