0% found this document useful (0 votes)
89 views11 pages

Review Guidelines For Customizing A Number Format

This document provides guidelines for customizing number formats in Excel. It explains that number formats can have up to four sections for positive, negative, zero, and text values. Various code sections and characters can be used to control decimal places, thousands separators, colors, text display, and other number formatting options.

Uploaded by

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

Review Guidelines For Customizing A Number Format

This document provides guidelines for customizing number formats in Excel. It explains that number formats can have up to four sections for positive, negative, zero, and text values. Various code sections and characters can be used to control decimal places, thousands separators, colors, text display, and other number formatting options.

Uploaded by

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

2/2/22 18:18 Review guidelines for customizing a number format

Microsoft 365
SupportOffice All Microsoft
Windows
Office support Surface
Xbox Search

Products

Devices

Deals
Buy Microsoft 365

Review guidelines for


What's new

Install Office

customizing a number format


Account & billing

Templates

Excel
More for Microsoft
support
 365, Excel 2021, Excel 2019, Excel 2016, Excel 2013, Excel 2010

To create a custom number format, you start by selecting one of the built-in number
formats as a starting point. You can then change any one of the code sections of that
format to create your own custom number format.

A number format can have up to four sections of code, separated by semicolons. These
code sections define the format for positive numbers, negative numbers, zero values, and
text, in that order.

<POSITIVE>;<NEGATIVE>;<ZERO>;<TEXT>

For example, you can use these code sections to create the following custom format:

[Blue]#,##0.00_);[Red](#,##0.00);0.00;"sales "@

You do not have to include all code sections in your custom number format. If you specify
only two code sections for your custom number format, the first section is used for positive
numbers and zeros, and the second section is used for negative numbers. If you specify
only one code section, it is used for all numbers. If you want to skip a code section and
include a code section that follows it, you must include the ending semicolon for the
section that you skip.

The following guidelines should be helpful for customizing any of these number format
code sections.

Guidelines for including text and adding spacing 

Display both text and numbers    To display both text and numbers in a cell, enclose
the text characters in double quotation marks (" ") or precede a single character with a
backslash (\). Include the characters in the appropriate section of the format codes. For
example, type the format $0.00" Surplus";$-0.00" Shortage" to display a positive
amount as "$125.74 Surplus" and a negative amount as "$-125.74 Shortage." Note that
there is one space character before both "Surplus" and "Shortage" in each code section.
https://support.microsoft.com/en-us/office/review-guidelines-for-customizing-a-number-format-c0a1d1fa-d3f4-4018-96b7-9c9354dd99f5?ui=en-u… 1/11
2/2/22 18:18 Review guidelines for customizing a number format

The following characters are displayed without the use of quotation marks.

$ Dollar sign

+ Plus sign

( Left parenthesis

: Colon

^ Circumflex accent (caret)

' Apostrophe

{ Left curly bracket

< Less-than sign

= Equal sign

- Minus sign

/ Slash mark

) Right parenthesis

! Exclamation point

& Ampersand

~ Tilde

} Right curly bracket

> Greater-than sign

https://support.microsoft.com/en-us/office/review-guidelines-for-customizing-a-number-format-c0a1d1fa-d3f4-4018-96b7-9c9354dd99f5?ui=en-u… 2/11
2/2/22 18:18 Review guidelines for customizing a number format

$ Dollar sign

Space character

Include a section for text entry    If included, a text section is always the last section in
the number format. Include an "at" character (@) in the section where you want to
display any text that you type in the cell. If the @ character is omitted from the text
section, text that you type will not be displayed. If you want to always display specific
text characters with the typed text, enclose the additional text in double quotation
marks (" "). For example, "gross receipts for "@

If the format does not include a text section, any non-numeric value that you type in a
cell with that format applied is not affected by the format. In addition, the entire cell is
converted to text.

Add spaces    To create a space that is the width of a character in a number format,
include an underscore character (_), followed by the character that you want to use. For
example, when you follow an underscore with a right parenthesis, such as _), positive
numbers line up correctly with negative numbers that are enclosed in parentheses.

Repeat characters    To repeat the next character in the format to fill the column width,
include an asterisk (*) in the number format. For example, type 0*- to include enough
dashes after a number to fill the cell, or type *0 before any format to include leading
zeros.

Guidelines for using decimal places, spaces, colors, and conditions 

Include decimal places and significant digits    To format fractions or numbers that
contain decimal points, include the following digit placeholders, decimal points, and
thousand separators in a section.

0 (zero) This digit placeholder displays insignificant zeros if a number has fewer
digits than there are zeros in the format. For example, if you type 8.9, and
you want it to be displayed as 8.90, use the format #.00.

# This digit placeholder follows the same rules as the 0 (zero). However, Excel
does not display extra zeros when the number that you type has fewer digits
on either side of the decimal than there are # symbols in the format. For
example, if the custom format is #.##, and you type 8.9 in the cell, the
number 8.9 is displayed.

https://support.microsoft.com/en-us/office/review-guidelines-for-customizing-a-number-format-c0a1d1fa-d3f4-4018-96b7-9c9354dd99f5?ui=en-u… 3/11
2/2/22 18:18 Review guidelines for customizing a number format

? This digit placeholder follows the same rules as the 0 (zero). However, Excel
adds a space for insignificant zeros on either side of the decimal point so
that decimal points are aligned in the column. For example, the custom
format 0.0? aligns the decimal points for the numbers 8.9 and 88.99 in a
column.

. This digit placeholder displays the decimal point in a number.


(period)

If a number has more digits to the right of the decimal point than there are
placeholders in the format, the number rounds to as many decimal places as there are
placeholders. If there are more digits to the left of the decimal point than there are
placeholders, the extra digits are displayed. If the format contains only number signs (#)
to the left of the decimal point, numbers less than 1 begin with a decimal point; for
example, .47.

To display As Use this code

1234.59 1234.6 ####.#

8.9 8.900 #.000

.631 0.6 0.#

12
12.0
#.0#
1234.568    1234.57

44.398
  44.398
???.???
102.65
102.65

2.8     2.8

(with aligned decimals)

5.25
5 1/4
# ???/???
5.3 5 3/10

(with aligned fractions)

Display a thousands separator    To display a comma as a thousands separator or to


scale a number by a multiple of 1,000, include the following separator in the number
format.

https://support.microsoft.com/en-us/office/review-guidelines-for-customizing-a-number-format-c0a1d1fa-d3f4-4018-96b7-9c9354dd99f5?ui=en-u… 4/11
2/2/22 18:18 Review guidelines for customizing a number format

, Displays the thousands separator in a number. Excel separates thousands


(comma) by commas if the format contains a comma that is enclosed by number
signs (#) or by zeros. A comma that follows a digit placeholder scales the
number by 1,000. For example, if the format is #.0,, and you type
12,200,000 in the cell, the number 12.200.0 is displayed.

To display As Use this code

12000 12,000 #,###

12000 12 #,

12200000 12.2 0.0,,

Specify colors    To specify the color for a section of the format, type the name of one
of the following eight colors enclosed in square brackets in the section. The color code
must be the first item in the section.

[Black]

[Green]

[White]

[Blue]

[Magenta]

[Yellow]

[Cyan]

[Red]

https://support.microsoft.com/en-us/office/review-guidelines-for-customizing-a-number-format-c0a1d1fa-d3f4-4018-96b7-9c9354dd99f5?ui=en-u… 5/11
2/2/22 18:18 Review guidelines for customizing a number format

Specify conditions    To specify number formats that will be applied only if a number
meets a condition that you specify, enclose the condition in square brackets. The
condition consists of a comparison operator and a value. For example, the following
format displays numbers that are less than or equal to 100 in a red font and numbers
that are greater than 100 in a blue font.

[Red][<=100];[Blue][>100]

To apply conditional formats to cells (for example, color shading that depends on the
value of a cell), on the Home tab, in the Styles group, click Conditional Formatting.

Guidelines for currency, percentages, and scientific notation format 

Include currency symbols    To type one of the following currency symbols in a number
format, press NUM LOCK and use the numeric keypad to type the ANSI code for the
symbol.

To enter Press this code

¢ ALT+0162

£ ALT+0163

¥ ALT+0165

ALT+0128

Note: Custom formats are saved with the workbook. To have Excel always use
a specific currency symbol, you must change the currency symbol that is
selected in the Regional Options in Control Panel before you start Excel.

Display percentages    To display numbers as a percentage of 100 — for example, to


display .08 as 8% or 2.8 as 280% — include the percent sign (%) in the number format.

Display scientific notations    To display numbers in scientific (exponential) format, use


the following exponent codes in a section.

E Displays a number in scientific (exponential) format. Excel displays a number to


(E-, the right of the "E" or "e" that corresponds to the number of places that the
https://support.microsoft.com/en-us/office/review-guidelines-for-customizing-a-number-format-c0a1d1fa-d3f4-4018-96b7-9c9354dd99f5?ui=en-u… 6/11
2/2/22 18:18 Review guidelines for customizing a number format

E+, decimal point was moved. For example, if the format is 0.00E+00, and you type
e-, 12,200,000 in the cell, the number 1.22E+07 is displayed. If you change the
e+) number format to #0.0E+0, the number 12.2E+6 is displayed.

Guidelines for date and time formats 

Display days, months, and years    To display numbers as date formats (such as days,
months, and years), use the following codes in a section.

m Displays the month as a number without a leading zero.

mm Displays the month as a number with a leading zero when appropriate.

mmm Displays the month as an abbreviation (Jan to Dec).

mmmm Displays the month as a full name (January to December).

mmmmm Displays the month as a single letter (J to D).

d Displays the day as a number without a leading zero.

dd Displays the day as a number with a leading zero when appropriate.

ddd Displays the day as an abbreviation (Sun to Sat).

dddd Displays the day as a full name (Sunday to Saturday).

yy Displays the year as a two-digit number.

yyyy Displays the year as a four-digit number.

To display As Use this code

Months 1–12 m

https://support.microsoft.com/en-us/office/review-guidelines-for-customizing-a-number-format-c0a1d1fa-d3f4-4018-96b7-9c9354dd99f5?ui=en-u… 7/11
2/2/22 18:18 Review guidelines for customizing a number format

To display As Use this code

Months 01–12 mm

Months Jan–Dec mmm

Months January–December mmmm

Months J–D mmmmm

Days 1–31 d

Days 01–31 dd

Days Sun–Sat ddd

Days Sunday–Saturday dddd

Years 00–99 yy

Years 1900–9999 yyyy

Display hours, minutes, and seconds    To display time formats (such as hours,
minutes, and seconds), use the following codes in a section.

h Displays the hour as a number without a leading zero.

[h] Displays elapsed time in hours. If you are working with a formula that
returns a time in which the number of hours exceeds 24, use a number
format that resembles [h]:mm:ss.

hh Displays the hour as a number with a leading zero when appropriate. If the
format contains AM or PM, the hour is based on the 12-hour clock.
Otherwise, the hour is based on the 24-hour clock.

https://support.microsoft.com/en-us/office/review-guidelines-for-customizing-a-number-format-c0a1d1fa-d3f4-4018-96b7-9c9354dd99f5?ui=en-u… 8/11
2/2/22 18:18 Review guidelines for customizing a number format

h Displays the hour as a number without a leading zero.

m Displays the minute as a number without a leading zero.

Note: The m or mm code must appear immediately after the h or hh code


or immediately before the ss code; otherwise, Excel displays the month
instead of minutes.

[m] Displays elapsed time in minutes. If you are working with a formula that
returns a time in which the number of minutes exceeds 60, use a number
format that resembles [mm]:ss.

mm Displays the minute as a number with a leading zero when appropriate.

Note: The m or mm code must appear immediately after the h or hh code


or immediately before the ss code; otherwise, Excel displays the month
instead of minutes.

s Displays the second as a number without a leading zero.

[s] Displays elapsed time in seconds. If you are working with a formula that
returns a time in which the number of seconds exceeds 60, use a number
format that resembles [ss].

ss Displays the second as a number with a leading zero when appropriate. If


you want to display fractions of a second, use a number format that
resembles h:mm:ss.00.

AM/PM, Displays the hour using a 12-hour clock. Excel displays AM, am, A, or a for
am/pm, times from midnight until noon and PM, pm, P, or p for times from noon
A/P, a/p until midnight.

To display As Use this code

Hours 0–23 h

Hours 00–23 hh

https://support.microsoft.com/en-us/office/review-guidelines-for-customizing-a-number-format-c0a1d1fa-d3f4-4018-96b7-9c9354dd99f5?ui=en-u… 9/11
2/2/22 18:18 Review guidelines for customizing a number format

To display As Use this code

Minutes 0–59 m

Minutes 00–59 mm

Seconds 0–59 s

Seconds 00–59 ss

Time 4 AM h AM/PM

Time 4:36 PM h:mm AM/PM

Time 4:36:03 P h:mm:ss A/P

Time 4:36:03.75 h:mm:ss.00

Elapsed time (hours and minutes) 1:02 [h]:mm

Elapsed time (minutes and seconds) 62:16 [mm]:ss

Elapsed time (seconds and hundredths) 3735.80 [ss].00

Need more help?

How can we help you? 

https://support.microsoft.com/en-us/office/review-guidelines-for-customizing-a-number-format-c0a1d1fa-d3f4-4018-96b7-9c9354dd99f5?ui=en-… 10/11
2/2/22 18:18 Review guidelines for customizing a number format

Expand your skills


EXPLORE TRAINING 

Get new features first


JOIN MICROSOFT OFFICE INSIDERS

 Thank you for your feedback!

What's new Microsoft Education Enterprise Developer Company


Store
Surface Pro 8 Microsoft in Azure Microsoft Visual Careers
Account profile education Studio
Surface Laptop AppSource About Microsoft
Studio Download Office for Windows Dev
Center students Automotive Center Company news
Surface Pro X
Microsoft Store Office 365 for Government Developer Privacy at
Surface Go 3 support schools Center Microsoft
Healthcare
Surface Duo 2 Returns Deals for Microsoft Investors
students & Manufacturing developer
Surface Pro 7+ Order tracking parents program Diversity and
Financial services inclusion
Windows 11 apps Virtual Microsoft Azure Channel 9
workshops and in education Retail Accessibility
HoloLens 2 training Microsoft 365
Dev Center Security
Microsoft Store
Promise Microsoft 365
Developer
Flexible Program
Payments
Microsoft
Garage

 English (United States)

Sitemap
Contact Microsoft
Privacy
Terms of use
Trademarks
Safety & eco
About our ads
© Microsoft 2022

https://support.microsoft.com/en-us/office/review-guidelines-for-customizing-a-number-format-c0a1d1fa-d3f4-4018-96b7-9c9354dd99f5?ui=en-… 11/11

You might also like