Custom number formatting in Excel is a very powerful tool, and once you learn how to use it property, your options are almost unlimited. This tutorial explains the basics of the Excel number format and provides the detailed guidance to create custom formatting. Continue reading
Comments page 5. Total comments: 642
You and your team always help the others may God bless you.
I have question in our areas we often use 500/- in the place of .00 like as 500.00 but we use 500/- and also using this style in adding or substract or multiply so in excel any format of currency that used /- style like as decimal .00 and working as zero
Hello!
You can change the decimal delimiter.
Go to Excel Options.
Go to the "Settings" - "Advanced" section.
Uncheck the option to use system separators.
In the window that is now active, replace the dot with /.
After pressing the OK button, all numbers with a fractional part will be displayed in a new way.
Using a custom format of #,###.## so that decimals will only appear if there is a need for them does however lead to this display showing say 5 as 5. which looks strange. Is there any way to omit the decimal point, if there are no decimals to be displayed?
Hi!
If you have selected a number format with decimal places, then the dot will always be displayed.
HI Alexander, thanks for this great article!
I'd like to use colors in Custom Format to highlight errors, ie, get a #N/A or #DIV/0 in Magenta. However, Excel does not recognize the error code as text, nor as a number. Is there any way to have the error codes in a different color?
Thanks so much!
Hello!
Create a conditional formatting rule with a formula
=ISERROR(A1)
This should solve your task.
Is it possible to specify different cell format for odd and even number? Thanks.
Hello!
Create two conditional formatting rules - one for even and one for odd numbers.
I hope I answered your question. If something is still unclear, please feel free to ask.
I have some numbers I am working with in a pivot table. I am wanting them in thousands. I have formatted them with "$#,##0,K" and they look great. For example 4234 shows up as $4K. However when I go to group these I get something like 0-5000. Is there any way to format this as 0K-5K? Thanks
Hello!
"0-5000" is text. You cannot format it as a number.
I have numbers formatted and customized with prefix numbers, but I want to copy it at a whole as shown including the preformatted numbers,
Example: Inputed as 10 but with a prefix number of "295500901000000" so the result becomes "2955009010000010"
but, I want to copy the whole result number to "2955009010000010" instead of "10"
Can help me fix them? Thank you in advance.
Hi!
Excel accepts and processes numbers only up to 15 digits, and displays no more than 11 digits for a numeric value. Anything greater is shown in exponential (scientific) format, such as 1.111E+14
You can automatically add a number as you type using a VBA macro
Thank you Sir Alexander for replying, I really appreciated it. Here is my concern:
How can I copy a cell with a value entered as 2340 (example only), but it was formatted with prefix the 2955009, so the result would become “29550092340” (joined the value entered).
Value entered: 2340
Result: 29550092340
Question: If I copied the result, the value showed just 2340, but I want to copy the whole result of 29550092340.
Please assist me how; thank you very much.
Hi!
Try to use Paste Special - Paste Values and Number Formatting.
The separators are not correctly separating the number. Not sure how to fix it. i need separator in hundred place. I tried formatting it but it kept on putting the separator in the thousand place. For example: 1234567.89 when I format this number to include separators it's showing as 12,34,567.89. How can I fix it? I checked the setup also (File>options>Advanced) but wasn't able to fix it. Please advise.
Hi!
In Excel's custom number format, only the thousands separator is provided, not the hundreds separator.
yes, you are right sir., but i need separator in hundred place. can Is it possible to have a hundred separator.
Hi,
I'm trying to understand if this is possible - K12343-4-AB1-F888 ? Can I force excel inputs to be this specific string of alphabets, numbers and hyphens?
Thanks, in advance!
Hello!
You can use regular expressions to validate data. I recommend reading this guide: Excel Data Validation using regular expressions (Regex). This should solve your task.
Hi,
Id like to appreviate currencies per the below:
$1,234,567 show as $1,235
$730,935 show as $731
$50.357 show as $50
can you please assist with correct format code?
Hi!
Pay attention to the following paragraph of the article above: Round numbers by thousand, million, etc.
It covers your case completely.
Try custom format:
$#,##0,
Hi, I have a cost sheet template that displays the cost of items with 2 decimal places, however, I am using the formula 0;-0;;@, to display any zero or null values as blank. However, I want to apply that formula to all fields, but where there is a value, I need it to display 2 decimal points, and I cant find a formula that can be applied to all cells to tell them to display zero if no value, but if there is a value, display 2 decimal places. thank you in advance
Hello!
Use conditional formatting to apply a 2-digit format to cells that have values. I hope this will help, otherwise don't hesitate to ask.
Hello,
I have a problem with prices.
In all tables, my prices are like this: 2290 and are supposed to be 22.90
Is there any way to fix them all together, not going one by one?
Hello!
Divide the numbers in your pricing columns by 100. The following tutorial should help: How to divide a column by a number.
Hi,
I have $5,775 and want to display this as US$ 5,775
Thank you in advance.
Hi!
Try this number format "US"$ #,##0;-"US"$ #,##0
Hope this is what you need.
What bothers me about Excel customizations is that Excel will not allow me to save them to use in other worksheets. I can make a template but that requires a lot of clunky cutting and pasting. Why not allow users a .ini file to save customizations of different types that could be used universally as if they were native?
How to remove text from cells with custom formatting like dilip.choudhury@ gmail.com will show as dilip.choudhury. I know this can be done with excel functions, vba..etc. Is it possible to do with excel custom feature option.
Hi!
The following tutorial should help: Excel substring functions to extract text from cell.
Please try the following formula:
=LEFT(A2,SEARCH("@",A2)-1)
Thanks for a great article!
Is it possible to display a percentage value without the percentage sign using custom number formatting? I want the chart labels for each data point to be displayed without %.
What I have: 65%
What I want to display: 65
I cannot change (like x*100) because it is used in the graphs and in other calculations. I also do not want to add an extra column with a new value.
Hi!
65% is the number 0.65
You can't show it as 65 using a custom format
Ah, too bad! Thanks
Hi,
Can someone help me make my excel cell that looks like 12345, look like 1ha23a45m?
That is the system for the area In my country.
Even something like 1,23,45 could help a lot.
I really appreciate any help you can provide.
Hi!
It is not possible to do this with a custom number format. You can turn your number into text with the Excel substring functions to extract text from a cell.
=LEFT(A1,1)&"ha"&MID(A1,2,2)&"a"&RIGHT(A1,2)&"m"
Try this on a cell containing 12345
#"ha"##"n"##
H,
I am using [>=10000000]##\,##\,##\,##0;[>=100000] ##\,##\,##0;##,##0
to show the number as 1,11,11,111.
Subtracting two number using above format, I will get the result in same format as shown below.
A1=3,45,67,890
B1=2,34,56,789
C1=1,11,11,101 (A1-B1)
But, i need to have plus (+) and minus (-) based on operation.
Here C1 should show like +1,11,11,101 and D1 (b1-a1) = -11,111,101
Hello!
Tru this custom number format:
+###,###;-###,###
Hope this is what you need.
Hi,
Hope you are well.
i have data with 0, 10%, 30 (example) so when I do custom format to hide zero I have used 0;-0;;@ so it hides 0 but 10% became 0. Please advise what is the issue and how I can hide 0 and keep the rest number as it is.
Look forward to your reply
Thanks
Razib
Hi,
Hope you are well.
i have data with 0, 10%, 30 (example) so when I do custom format to hide zero I have used 0;-0;;@ so it hides 0 but 10% became 0. Please advise what is the issue and how I can hide 0 and keep the rest number as it is.
Look forward to your reply
Thanks
Razib
Hello!
Try this custom format:
#;-#;;@
I hope it’ll be helpful.
Hi Alexander,
Thank you for your prompt reply.
I have tried #;-#;;@ but its hiding 0 and 10% both. I want to hide only 0 and keep 10% sales and other numbers same.
Is there any other thought ?
Look forward to your reply.
Thanks
Razib
Hi!
Percentage format (10%) and number format (30) cannot be combined in the same custom format.
Hi,
But both are in different cell. 0% is one cell and 10% is another cell. So can’t do custom format to hide 0 and keep 10% as it is ?
Please advise
Hi!
Custom formats follow a structure with up to four sections separated by semicolons. Use the third section to hide null values: 0.0%;0.0%;""
Please re-read the paragraph above: Understanding Excel number format.
I have a currency format "#,##0.00" when the computer is configured the language of the ENG system separates by thousands and in ESP it does so by millions. how can the format be standardized
Hello! Fantastic article, I have used it a lot in the past year!
I have the following problem. I have a set of numbers in a column, some are integers, some are decimals. If I use something like #.##, then the integers appear with a dot at the end (ie. "42."), instead of just the number. Is there any way to make the decimal point conditional?
(I am sorry if this has been asked already, I scrolled for a while but there are a lot of comments...)
Thanks! Kalman
Hello!
Unfortunately, if you have selected a number format with a decimal separator, it will always be displayed.
Ah never mind, I found the comment in the end where it is confirmed that it cannot be done :( It is weird though, one would expect to see whole numbers without a point in the end. I constantly need to explain this behavior to users which is annoying.
In practical, I am using this method often (eg. #,##0,↑;[red]#,##0,↓;-). Unfortunately when ever I copy-paste into PowerPoint table, the Font Color format can't be copied into the PowerPoint.
I checked using vba script of the cell target using script "rng.Font.ColorIndex" the result seems is not match with the shown font color that perform by Number Format.
Is there any vba script to verify the color shown by Number Format?
Hello Alexander,
Thank's a lot for your fast response.
I've been trial GetCellFontColor function to get the color code of a cell that use custome number format below,
number format : #,##0,↑;[red]#,##0,↓;-
trial number1 : 1000 (shown font color black). Validate using GetCellFontColor, Result = 0
trial number2 : -1000 (shown font color red), Validate using GetCellFontColor, Result = 0 (instead 255 for red color).
It seems the GetCellFontColor is using xlRange.Font.Color that work on cells, It can't detect the font color that produce by custome number format.
Do you have any alternate function that can validate font color that produce by custome number format?
I'll be greatfull for your advice.
Hello!
If you run the macro SumCountByConditionalFormat, which calculates the sum of cells by color with conditional formatting, you will see not only the sum, but also the code for the color you selected.
I hope my advice will help you solve your task.
Hello!
You may find the Excel User Defined Functions useful: GetCellFontColor and GetCellColor. They allow you to get the color code. You can find them in this blog post: How to count and sum cells by color in Excel.
I hope it’ll be helpful.
Ok firstly thankyou for this detailed article on custom number formating. I have struggling with it specially because i am from india and use indian number system which consists of lakhs/crore and not million billion. Was searching everywhere right from youtube but no success.. finally read this article and now i can show values in crores or in lakh.
Great article - thanks. So much information here that you can't find elsewhere.
I'm having trouble with a custom format. I'm trying to show a number in 4 digit format with a letter at the end. For example "50A" would show at "0050A", or "180C" would show as "0180C".
Obviously if i remove the trailing letter from the cell i can get the 0000 custom type to work for the number alone, but when putting the trailing letter back in I don't know what to change my custom format too to also show the letter as well but also stay in the 4 digit format. Can you help?
you can use custom format. just right click the cell and after your number format put "Aa".
I.e. I wanted to calculate hours worked but I wanted "hrs" to show up after the numerical part of the result, so in custom I put: 00.00"hrs". If I wanted a space between the number and hrs I would just include a space between the last 0 and the quation mark like: 00.00 "hrs"
Hello!
Your data is text, not a number. Therefore, the 0000 custom format cannot work here. You can get the value you need in another cell using text functions.
Thank You.
Hi - Really informative article - appreciate all the details.
I'm wondering if there is a way to hide blanks for currency, but have it apply to multiple currency types. My document displays either $ or € based on some other conditional formatting I've got built-in, but I can't seem to find a way to hide cells with a value of €0.00... it only seems to work for $0.00.
Under cell formating, using custom formula, I'm using $#,##0.00;($#,##0.00); which I imagine only works for those cells with the $ currency type - is there a way to make this formula or something similar apply to both $ and €?
Any help would be appreciated.
Hello!
€0.00 values will not be shown with this custom format:
€#,##0.00;(€#,##0.00);
Hope this is what you need.
Hi - Thank you for the quick response!
This seems to work only if the cell is in €. In this use case, the cell this formula is applied to varies between either $ or € depending on other conditional formatting variables. Is there a single formula/format that supports hiding multiple currencies or is that not possible?
Thanks again.
Hello!
The formula cannot change the formatting of the cell. A VBA macro can do this. Use conditional formatting for different formats.
Hi! I have a series of fractions in 1 row that I would like Excel to convert to the percent format in the next row. How do I do this?
Thanks!
Hello!
On this row, make a reference to the original data and apply the percentage format.
Hi,
Looking for a custom number format that shows 450 as 0'5 and -450 as -0'5 (in red).
0.0,;[Red]-0.0, shows 0.5 and -0.5, but need to show an apostrophe.
Thanks,
Simon
Hello!
To replace the period separator with an apostrophe in a number, use the SUBSTITUTE function:
=SUBSTITUTE(TEXT(A1,"0.0,;[Red]-0.0,"),".","'")
i already made it as a conditional formatting for other non error cells and it keeps the data of the cell but it change it appearance to preview a "TEXT". however, i couldn't do the same to na() cells.
Hello,
I have an excel sheet that counts the number of data and reflects it on a pi-chart. however, i found it better to reflect zero cells as #N/A in order to not let it be visible in the chart until it gets a count.
is there a way to format #N/A (basically error cells) as "TEXT" instead?
Hi!
Try using the IFNA or ISNA function. You can find examples in this article.
I hope this will help, otherwise please do not hesitate to contact me anytime.
As I am using the cell value in a pie chart I would like to exclude the zero values cells from being shown in the chart and found out the best way is to have the zero cells as #N/A. however, I would like to change the cell appearance to show "ZERO" instead of #N/A while keeping their values.
I have tried using IFNA and ISNA functions in the Formatting and in the Conditional Formatting but it didn't work out for me, is there any other methods I can try to get this result?
Hello!
Conditional formatting cannot solve your problem. Formatting cannot replace the value in a cell. It can change its appearance. I can suggest using the IFERROR function in the formula.
Actually what I am trying to do is to change only the appearance of the cell to show "ZERO" while maintaining the value of the cell as #N/A.
is it possible to use these functions in the formatting? because i would like to keep the cell value as #N/A
Hi,
Thanks for the great page. Very through and structured.
One query, though.
Take the number 27618263177.12
How can I custom format the cell so that it is shown as 2761.83. Basically, what I mean is I wish to use the Crores format.
Hello!
In custom Excel formats, you can show the number in thousands or millions. Unfortunately, your task does not match these possibilities. You can apply to round of numbers as described in this tutorial.
Hi,
Very good blog. Thank you.
My problem is: I am dealing with a lab measurement. I need conditional decimal point length depending on another column. As follows
if A1 = 0.001 C1 = 6.000
A1= 0.1 C1= 6.0
A1= 0.010 C1=6.000
A1=0.02 C1=6.00
Kindly Help me. Thank you
Hello!
Unfortunately, a custom format in Excel cannot use data from another cell. Your problem can be solved with a VBA macro.
hey i want to get the number format where i can fix the number and change the values after decimal points .is this possible with custom format please reply me.for example i want to fix 12 then if i enter 75 then i want it as 12.75.
Hey, you can't do that with a custom number format. VBA macro can be used.
Hi, How are You,
I need to custom number format code in below format ( 12 Nuber )
123456789025 Change of 1XXX XXXX 9025
Pl. provide custom codeing
thanks for help
Hi!
You cannot solve your problem with a custom number format.
Hi Alex,
I need assistance in excel format cells. I want to enter a number with 5 or 6 digits that will be in the following form
9203 - 7 or 9203 - 77
4 digits fixed dash 1 or 2 digits depending on whether the number is 5 or 6 digits
When i enter number with 5 digits and it is formatted like this 0000 "-" 00 it is displayed as 0920 - 37 and should be 9203 - 7,
and if I format it as 0000 "-" 0 then it is ok, but when I have a 6 digit number then with this format it shows me 92037 - 7.
Thank you a lot, that was very helpful,
tariq
Saudi Arabia
I deal with measurement units. Displaying the unit tells the reader what the number means. For instance, the format #,##0,, "MHz" will display the number 100000000 as 100 MHz. So I know the number means frequency. Similarly, I can use the format #,##0, "km" to display distances. I would like a way to display time so that the number 0.0015 is displayed as 1.5 msec or 1500 microsec. Is that possible?
Hello!
I don't think this is possible within the same cell using formats. You need to use formulas.
Thanks for your comprehensive article.
Is there a way to extract a useful cell format from a referred to cell? If i do a =CELL("FORMAT",A1) and A1 is formatted Accounting with 2 decimal places, AKA (almost) #,##0.00 the value returned is ",2"
",2" is not useful in a =TEXT(A1,CELL("FORMAT",A1)) formula. I have to use a xref table to keep the formatting.
So I want Excel to return #,##0.00 instead of ",2" so I can ditch the xref table...
Thanks!
Hello!
Unfortunately, you can only extract a custom format from a cell using VBA.
Hi Alex,
I need assistance in excel format. I have variance column which is column A minus column B. The result is rounded to zero decimal point using excel format.
Now I dont want the variance to appear as Zero. If I have variance as 0.123 or 0.56 it should appear as dash (-) insted of Zero. Negative numbers should appear in red under bracket (15) or (-).
Do we have any format option here.
Hello!
Custom Format indeed consists of 4 sections separated by a semicolon. Each section has its own assignment: 1 – format for positive numbers, 2 – format for negative numbers, 3 – format for zeros, 4 – format for text values. A user-defined number format can also contain up to two conditions which are entered in square brackets, e.g. [> 1] or [<= 1].
When you use conditions in a user-defined number format, you redefine the first, second and third sections. For example, Custom Format for you -
[>1] 0;[Red] -## ; "-"
Hi Alex, thank you for the format. It works however i just want to understand what can be changed in above format so that if my number is -0.234, that also should appear as dash under bracket (-) insted of (0). The above format is working fine for positive & negative number and even if I have positive 0.234 its giving me dash insted of zero. But I need to keep an eye everytime when the output is in negative 0.234 so that it can be formatted as (-).
Hi!
Carefully read the article above and simply add brackets into a negative number format
[>1] 0;[Red] (-##) ; "-"
Hi Alex, Currently i am using below Combination of format which is giving me the result as
[>0.5]$#,###0;[Red]$(#,###); "-"
First portion of format
1000.23= $1,000
0.234= $- i dont want dollar
0.534= $1
Second portion of format
-1000.23 = $(1,000)
-0.523 =$(1)
-0.234 =$(-) i dont want this, i need only dash here no dollar no bracket
Third portion of format
0= -
Hello!
To apply more than two conditions to negative numbers, use conditional formatting.
I have an Excel column with over 70,000 entries in this format: 123456789A12345. All of them are nine numbers followed by a letter, followed by five more numbers.
I'm trying to get it into the a format like this: 1-23-456-78-9A-12345. I have typed in a custom format of #-##-###-##-#-##### but it only works if there were no letters and every cell has the letter in the tenth position. Is there a symbol, like # that will allow the letter to be used in my custom format? Thanks.
Hello!
You cannot apply number format to text. Try this formula:
=LEFT(A1,1)&"-"&MID(A1,2,2)&"-"&MID(A1,4,3)&"-"&MID(A1,7,2)&"-"&MID(A1,9,2)&"-"&MID(A1,11,5)
HI Dear expert community,
I'd like to get your advise, is it possible to add more that 1 conditional under Format Cell /Custom, I have this:
[=1799.99]"Door";[=1200]"Box"
but would like 2 add another to variables, I tried this, but didn´t work:
[=1799.99]"Door";([=1200]"Box";([=1800]"Side";[=2400]"Top")
[=1799.99]"Door";[=1200]"Box";[=1800]"Side";[=2400]"Top"
Could anybody give a hint?
I appreciate your kind support :D
Hi!
Unfortunately, this is not possible.
Very Detailed Article. No Words to appreciate....
Very Helpful...
Thanks for such a long article...
Hi i am aware of the , and ,, rounding to thousands an millions in number formatting.
However is there a way to round to the nearest tenth or hundreds in number formatting? I would like to preserve the original value in the cell (instead of round/up/down)
e.g. value 2431 display as 2430 (to nearest 10)
Display as 2400 ( to nearest 100)
Thx.
Hi!
The format can show the number in tens. But it cannot round to 10.
So which format code should I use to SHOW in tens?
Hi!
If you are using this custom format
#0"."0
then the number 158 will be shown as 15.8
how can I split MP53HA2219 to MP 53 HA 2219 (needs to insert the space) {format will be same always}
I solved the problem partially by holding the Alt key and entering 010, however, if I reduce the wide column, I have XXXXXXXXXXXXXXXX instead of the value...
hello Alex
I need to wrap the text in custom formatting as the column becomes too wide and spoils the excel sheet, is there a way to do that.
this is what I have:
"TOTAL PICK AISLE LOAD ("#,##0"kg/m2)"
The column width is for the full text, I need to some how wrap it with in the custom formatting not from the tab as it does not work...
Hi,
I am using Excel with the region set to India. The numbers display as 1,00,000 by default. I want to change a few cells in this to display in the million 1,000,000 format.
The default setting of #,##0 does not work and it displays as 1,00,000. Looks like putting in this format defaults to the default setting.
Any suggestions? I do not want to change the region.
Thanks.
Hi!
The default format uses the regional settings.
Thank you so mush for this complete and useful tutorial. What is the difference between #,##0 and #,# for thousand separator?
Thanks, this info really helpful :)
Hi, I'm trying to format my columns to where I type.25 and it turns to 0.25% but I keep getting 25.0% can anyone help please?
Hello!
Use custom number format
0.00"%"
I hope it’ll be helpful.