Excel Custom Number Format Guide
Excel Custom Number Format Guide
Courses Pricing Members Blog Help Desk Excel Webinars Excel Add-ins
You are here: Home / Excel / Excel Custom Number Format Guide
Download the Excel Workbook. Note: This is a .xlsx le please ensure your
browser doesn't change the le extension on download.
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 1/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
This opens the Format Cells dialog box in the Number tab (below), where you can
choose ‘Custom’ from the Category list and insert your format in the ‘Type’ eld:
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 2/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Component1;Component2;Component3;Component4
Note: spaces around semi-colons above are added for clarity but are not required in
the format.
You may be familiar with number formats you nd in the Format Cells dialog box, like
90
this:
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 3/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
In the above example only the positive and negative formats are speci ed, in which
case the zero format will be the same as the positive format and text will be formatted
as it was entered.
1. When just one component is provided with no semi-colons in the code, Excel
will check to see if the format is one of the default ‘Number’ formats and revert
to that format. Otherwise, if the format is unique then all numbers will be
formatted according to the format provided.
2. When the rst two components are provided Excel will use the same format for
zero, and text will appear as entered.
3. When the rst three components are provided Excel will use the formats
speci ed, and text will appear as entered.
4. If any components are skipped or left blank e.g. in this format the negative
component has been skipped, #,##0;;0 and so the negative value will not display
as demonstrated below:
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 4/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 5/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
These characters are used as codes to tell Excel how to format the value. Let’s look at
them in turn.
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 6/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Digit Placeholders – used to control how numbers that contain decimal places are
displayed:
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 7/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Tip 1: We can scale a value to millions by using two commas, as you can see in the
example in the last column above. And for billions we add 3 commas.
Tip 2: When appending ‘K’ for thousands we simply type it in the format, but ‘M’ for
millions must be entered with a preceding \ as the example above, or inside double
quotes. This is because ‘M’ is already reserved as a character for the date formats.
More on date formats soon.
Tip 1: In the example in the last column above I’ve used the underscore and right
parenthesis to align the decimal places. You can see them in red in the number
format here: $#,##0.0,K_);($#,##0.0,K)
Remember the underscore is a special character that adds a space according to the
width of the following character, in this example the right parenthesis.
Tip 2: if you don’t have a particular currency key on your keyboard, you can enter it
into the Custom Number Format dialog box using the ANSI code. To enter an ANSI
code, hold the ALT key and type in the 4 digit number. Here are some example ANSI
codes that might be useful:
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 8/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Tip: You can also insert symbols like up or down triangles, just make sure they’re the
Arial Geometric Shapes (subset) variety and not Wingdings:
For example, this format displays positive percentages with an upward facing triangle
and negative values with a downward facing triangle.
▼0.0%;▲0.0%
Symbols can be quite e ective when used in reports or charts like the one below:
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 9/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Colors
We can specify a color for a format, for example you might like to format negative
values in red. Color formatting is done in one of two ways:
1. We can use the color name surrounded by square brackets, like so:
$#,##0.0,K_);[red]($#,##0.0,K)
[black]
[green]
[white]
[blue]
[magenta]
[yellow]
[cyan]
[red]
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 10/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
$#,##0.0,K_);[color 3]($#,##0.0,K)
Using the color number opens up a total of 56 di erent colors, although 5 of them
are duplicates, as you can see by the hex codes in red below:
Tip: Apply color formats to chart axes or labels. Note: if you have labels then you don’t
also need the vertical axis or gridlines, unlike my example below:
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 11/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Date Characters
We can combine the month, day and year characters together in various
con gurations to get the desired format. Here are a few examples:
Click
90 here for more on how dates and time are handled in Excel.
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 12/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Time Formats
Just like the date characters, we can combine the time characters to get the format
we’re after. For example:
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 13/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
And when we’re adding time that exceeds 24 hours, or 60 minutes, or 60 seconds we
can display the elapsed time like so:
Fractions
Let’s go back to school and recap some of the di erent types of fractions:
Proper – where the absolute value of the fraction is less than 1 e.g. 1/2
Improper – where the absolute value of the fraction is greater than or equal to 1
e.g. 4/3
Mixed Fractions – are another way to write improper fractions where the whole
is written separate to the fraction, for example 4/3 would be written 1 1/3
It’s important to remember that the underlying value in the cell, as displayed in the
‘Value’ column above, is what is used in your formulas that reference those cells. The
Formatted result is simply how it appears, but you must be careful if you are using
those formatted results in calculations that don’t reference the cell directly. For
example if you were to enter those formatted values into a calculator you’d get a
90
di erent result to a formula that referenced that cell.
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 14/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Percentages
Use the % sign to display numbers as a percentage of 100. Remember, a zero in the
custom number format displays both signi cant and insigni cant digits, and the # will
only display signi cant digits as per the examples below:
Scienti c Notation
Scienti c Notation allows us to express very large numbers in a decimal form of
shorthand. It’s commonly used by scientists and mathematicians. Let’s use
7,830,000,000 as our example value. I think you’ll agree it’s a pretty big number.
We raise 10 to the power of 9 because 9 decimal places have been removed from the
original number to be left with 7.83. And when we multiply 7.83 by 109 we get our
original value of 7,830,000,000. Ok, math lesson over.
In Excel (and some calculators) we can’t use ‘x’ in a number, nor can we insert
superscript. Instead we use the upper (or lower case) E+ notation like so:
7.83E+09 or 7.83e+09
Remember we can use 0 to display both signi cant and insigni cant digits, or if we
only want to display signi cant digits we use #.
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 15/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Did you notice the precision in the ‘Formatted Result’ of the 3rd example above? See
how it appears to round the value to one decimal place and therefore omits the ‘3’ in
7.83. Be wary of this if you’re likely to refer to the face value of these cells, as opposed
to the actual underlying value.
Remember to use the 0 digit place holder to show both signi cant and insigni cant
digits, and use the # to only display signi cant digits.
Engineering Notation
Engineering notation is a version of scienti c notation in which the exponent of ten
must be divisible by three. The format contains 3 # before the decimal place and 3
zeros after the decimal place to force the result to return an exponent that is divisible
by 3.
Text/Labels
We can append or pre x our values with text while still maintaining the underlying
number for use in formulas. This can be handy when formatting values like kilometres
or days/hours/minutes, Over/Under etc.
To display both text and numbers in a cell simply insert your text in double quotes, or
if it’s only a single character then precede it with a backslash (\).
*Don’t
90 forget, Literal Characters are displayed without the need for quotation marks.
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 16/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
The last example uses the @ symbol for Text. In other words, the cell is formatted as
text, which is also why it is left aligned, but the custom cell format displays the # tag at
the front of the text without the need to actually type it in the cell.
However, we can override the default components with up to two conditions and add
color coding based on criteria we set.
For example, let’s say we have a threshold of 500 units per day. Anything below this
should be red and anything 500 or above should be formatted green. We can use the
format:
Tip: once a condition is met Excel doesn’t test the other conditions so it’s important
you get the order of tests correct so it doesn’t stop at the rst criteria. Just like a
nested IF formula.
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 17/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
What if we want 3 conditions? Well, we can’t insert 3 conditions as such, but we can
insert 2 and then apply a font color to the cells, which will be picked up for all
remaining values. This works because custom cell formats override the font color.
In the example below values less than 500 are red, values less than 1000 are
orange/amber and values 1000 and over, for which there is no criteria, pick up the cell
font color, which is green:
It’s handy for phone number formats, bar codes, product codes etc. Here are a few
examples:
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 18/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Sources
I’d like to recognise the following resources which I learnt from in the writing of this
guide:
Please Share
If you liked this or know someone who could use it please click the buttons below to
share it with your friends on LinkedIn, Google+, Facebook and Twitter.
Free 100 Excel Tips & Tricks eBook – Click here to Download
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 19/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
If you have a question and need to provide a workbook/data, please open a topic on
the forum and attach the les.
Seeing the data will make it easier for us to understand your problem and give you
an answer.
Leave a Reply
Your email address will not be published. Required elds are marked *
Comment
Name *
Email *
Website
Post Comment
Comments
Steve says
January 21, 2019 at 5:41 am
Hi Mynda,
90
This is a GREAT article! Thank you for sharing your expertise!
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 20/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Question for you… Is there a way to save custom number formats in Book.xltm so
they’re available in all of the new workbooks that I create? I don’t want to save
Book.xltm with “pre-formatted cells,” but I’d like the custom number formats to be
available in the custom number list, if or when I need them.
Do I need to create new “Cell Styles” for the custom number formats to be
permanent? I’d experiment with this, but my computer is out for repair. Thanks.
Reply
Hi Steve,
There is no easy way to store custom formats to be available in any new
books. You can use a code in your Book.xltm that applies those formats to
some cells of the active workbook. The code can be attached to a button in
Book.xltm ribbon, to apply the format to selected cells. It’s even faster than
going through the normal menu.
Reply
Guru says
December 29, 2018 at 9:31 pm
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 21/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
of decimal.
Eg:
33.5 should be 33.5 itself
345.6 should be 346
5655000 should be 5.7M
56550000 should be 56.6M
565500000 should be 566M
Thanks in advance
Reply
Hi Guru,
You can’t do this with custom number formats. You’d have to use a formula
like IF(A1<1000000,A1,IF(A1>1000000,ROUND(A1/1000000,1),IF(… etc. to
round the values depending on their size.
Mynda
Reply
You missed one time code, decimal values for thousandths of a second ie
sss.000
This format code is needed for precise duration and interval calculation. I found that
this custom format works best for me
90
d “days” hh:mm:ss.000
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 22/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Good reference for custom data formats. A few more examples would be nice.
Unfortunately Excel converts the time display in the formula bar to a date/time
stamp starting at 1900-01-00 00:00:00 AM The decimal seconds are there, just not
displayed in the formula bar.
Reply
Reply
Very useful.
Reply
Reply
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 23/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Reply
Reply
o r says
October 10, 2017 at 6:54 am
You mentioned “Thousand Separators and Scaling” for big numbers (kilo and mega).
what about little numbers (milli, micro ,piko)?
Reply
Hi O r,
Great question! There’s no custom number format for these. You’d have to
normalize the numbers, as described here:
https://excel.tips.net/T002928_Engineering_Calculations.html
Mynda
Reply
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 24/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Shmuel says
February 23, 2017 at 6:54 pm
Hi Mynda
The usual “arrival time – departure time” gives erroneous results unless modi ed in
the following way:-
At the heart of the solution is the fact that Excel views time in fractions of 24hrs so
you would need to convert the di erence in hours between the two time zones into
a fraction of 24 then add or subtract this from the departure time in the formula
above e.g.
Warm Regards
Shmuel
Reply
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 25/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Cheers,
Mynda
Reply
This is a great article, Mynda! It got me wondering about what would happen if you
changed the color palette (because almost all my old templates use a custom color
palette). It turns out that the color codes for Color1-56 CAN be changed. For
example, [Color10] doesn’t always have to be green. You can go to File > Options >
Save > Colors and modify the color palette.
As another side note, the Color1-56 codes in Google Sheets are xed colors (but
match the default Excel color palette), so it doesn’t look like customizing a color will
translate into Google Sheets if you upload/convert your customized Excel le.
Reply
Cheers, Jon. Great tip about the custom color palette. I didn’t know about
that.
Mynda
Reply
Hussein says
February 21, 2017 at 3:04 pm
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 26/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
It is really amazing e orts. Do you mind if I translate your post to Arabic along with
the example le with keeping all the credit to you and your website?
viaexcel.com (website eld is not working in comment area).
Reply
Thanks, Hussein.
Yes, you’re welcome to translate my post with a link back to my site for
credit.
Cheers,
Mynda
Reply
Hussein says
February 22, 2017 at 2:49 pm
Reply
Amadou says
February 21, 2017 at 1:16 am
Very usefull tips especially when combined with Excel cells styles. I’ve just read the
article and it’s already saving me a lot of time. Thanks you so much for this !!
Reply
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 27/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Thanks, Amadou
Reply
Simon says
February 20, 2017 at 12:34 am
Hi Mynda
one of my favourite formats is when I want to show all numbers with the units in
line, negatives in red (for screen viewing) and in brackets (for printing).
For this, I use #,##0.00 ;[Red](* #,##0.00) and, because I frequently use it, I’very
made it into a macro and saved it in my personal sheet so that it available in any
worksheet I use.
There was some fantastic examples in yours that I never even realised that I wanted
to use before seeing them
Reply
Thanks for sharing your tip, Simon. It’s always nice to hear what other people
nd useful and I’m sure there are more who will like this format too.
Mynda
Reply
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 28/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Hi Mynda,
I released several year ago a similar workbook with a presentation to explain and
illustrate the custom formating however I never imagine to use symbols to illustrate
the grow of a metric like you done for charts. This tip is very interesting and this is
what i love from MVP simple tips that make a big di erence. Thanks a lot Mynda for
sharing this.
Best regards
Mehdi
Reply
Reply
Well, you moved the bar for “pillar” posts. Let’s just call this a “foundational” post! I
learned quite a few new tricks, some of which are eye-popping. This will be my go-to
guide for formatting numbers!
Cheers,
Mitch
Reply
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 29/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Reply
This guide is a great tool, the kind I like to save for future use. Is there a better way
to save it for o ine use than a .PDF? The challenge with printing it to .PDF is the
banner ads are still there and they block the guide.
Reply
Hi Bill,
Thanks for your email. We’ve added a ‘print’ icon to the left side of the page
above. Unfortunately it bunches up some of the images a bit but it’s the best
we can get it.
Kind regards,
Mynda
Reply
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 30/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Reply
Hi Bill,
In Mozilla, you can view the page in “Reader View” (this option is towards the
extreme right of the URL bar. In Reader View you get to see only the article
minus all the ads and sidebar items. You can then either print a .pdf le
using any of the free pdf conversion utilities like CutePDF, PDF-Viewer, etc.,
and save the pdf le to your system for o ine use.
Reply
jim says
February 18, 2017 at 3:00 am
Well done for keeping this to such a short article; it really is a HUGE topic!
a few additional points to confabulate your readers further (and there’s more!)
Using a number formatted as text as a number – can be done if you add a double
minus before it to force excel to evaluate it
Full year can also be formatted by using “e” instead of “yyyy”
Line feeds can be added to a format using ANSI code 10 (ALT+0010) – but dates will
still show as ###### if the column isn’t wide enough (use the TEXT function if this
really bugs you)
If you use a condition then the next rule is still used for negative numbers and the
next for others (eg [<-1] -0;0.0;-0.0 will apply the -0.0 format to all zeroes and
positives)
Colouring text using conditional formatting trumps number formatting (the two
condition limit in normal formatting can be annoying)
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 31/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Reply
On your condition example, just to clarify for others; it works that way
because you only have one condition, my examples have two conditions.
Reply
Fabio says
February 18, 2017 at 2:02 am
Reply
Thanks, Fabio!
Reply
Good article. Better than any I have seen done before. One point to be clear on, you
are absolutely correct that the format does not a ect the underlying value.
However, I don’t think you can say “…it doesn’t alter the underlying value that you
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 32/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
can see in the formula bar”. If you input a number like 43000 and format it as a date
then it does a ect what you see in the formula bar. Even if you format it as a
percentage it changes what you see in the formula bar slightly.
Reply
Reply
Cindy says
February 17, 2017 at 11:25 pm
Excellent workbook and a great resource! I know I will refer to it often. Thank you!
Reply
Reply
Serge says
February 17, 2017 at 11:21 pm
90
Reply
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 33/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Cheers, Serge
Reply
Thank you Mynda for the insight into custom number formatting. I have a question.
Is there a way to build your own custom number formatting? I need to have a eld in
my spreadsheets that is a letdown ratio ie: 25 to 1. I currently need to format the
column as text and type 25:1. I’d like to be able to have the column as a custom
number format rather than as text.
Reply
Hi Bob,
#":1"
Kind regards,
Mynda
Reply
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 34/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
Thank Mynda for an excellent guide on HOW TO with Custom Number Formatting.
Now I don’t have to wreck my brain to gure out How.
Reply
Reply
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 35/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
FREE WEBINARS
Excel Functions
Excel Formulas
Excel Custom Number Formatting
ALT Codes
Pivot Tables
VLOOKUP
VBA
Excel Userforms
Free Downloads
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 36/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 37/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 38/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
TESTIMONIALS
Christine
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 39/40
2/1/2019 Excel Custom Number Format Guide • My Online Training Hub
90
Shares
https://www.myonlinetraininghub.com/excel-custom-number-format-guide#_Toc474757761 40/40