how to understand number custom format

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
I want to understand these codes under number custom formatting. For example what does #,##0;-#,##0 mean or what does #,##0.00;[Red]-#,##0.00 mean.

Is there any website/video explain step by steps what these codes mean and how you can created your own.
I have seen some video/articles about this but no one really explain for example why they put 2 ## and what they put 0 in ##0 and what does #,##0 mean.. and why not ###,##0 instead.

I am sure there is a syntax or format to use these symbols to create rule or number formatting. Any help would be very much appreciate it. Thank you.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
in essence
#,##0.00;[Red]-#,##0.00
the # will suppress unnecessary zeros, the semi colon separates a positive or negative return, in this case it it would present with a minus sign and also in RED
 
Upvote 0
Thank you all for the help. I really appreciate it. I am reading now https://support.office.com/en-us/ar...r-format-78f2a361-936b-4c03-8772-09fab54be7f4
I tried to do a custome format with this code "people" @
basically i want to see if excel will add word "people" into the cell i select to format.
here what I have noticed:
if i have 2 cells, one has number = 10 and one has text= hello and then apply that formatting then the cell which has number, the number 10 move to the left of the cell but stay same 10 and the cell which has the text the text will be "people hello". After that, if I type any number or text inside the cell which has 10, the number or the text will be "people10"

My questions
1)Why the cell which has number, the "hello" word did not inserted while the cell which has the text, hello word inserted right away.
2) why the word "hello" inserted at the begging? can I change that to make it at the end, i mean after the text?

Thank you
 
Upvote 0
Another question please.
In that article i says the following

[FONT=&quot]0 (zero)[/FONT]
[FONT=&quot]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.
[/FONT]


<tbody style="box-sizing: border-box;">
</tbody>

but instead of #.00 i can write it like this 0.00 and both give same answer
What I do not understand when # is used and when 0 is used? thanks
 
Upvote 0
Another question please.
In that article i says the following

[FONT="]0 (zero)[/FONT][/COLOR]
[/TD]
[TD][COLOR=#2F2F2F][FONT="]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.
[/FONT]


<tbody style="box-sizing: border-box;">
</tbody>

but instead of #.00 i can write it like this 0.00 and both give same answer
What I do not understand when # is used and when 0 is used? thanks
I am not sure why they used 8.9 in their example as what they are talking about only applies to values less than one... the question revolves around whether to show the leading, insignificant zero in front of the decimal point or not...

for 0.8...

#.00 displays .80

whereas...

0.00 displays 0.80
 
Last edited:
Upvote 0
Hi all
In the same article above, the write said this formula


time4 AMh AM/PM

<tbody>
</tbody>

So i used that one. and whatever i type in the cell, it will be converted to 12 am ? and when i click on the cell to see what is the content, I found this:

01/01/1900 12:00:00 AM

Why is that?

Also in the same article, it says that

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

<tbody>
</tbody>
What does elapsed time mean? i do not see any use for that formatting thank you
 
Last edited:
Upvote 0
What does elapsed time mean? i do not see any use for that formatting thank you
How long does it take you to drive to work?
 
Upvote 0
...So i used that one. and whatever i type in the cell, it will be converted to 12 am ? and when i click on the cell to see what is the content, I found this:

01/01/1900 12:00:00 AM

Why is that?
You probably entered 1.5 into that cell

excel sees dates as days passed from 0/0/1900, to if you enter 1.5 in a cell formatted like yours, that I what it will show
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top