Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

adding a separate format for zero values and another one for text.

If you
enter a positive number as a currency value, Excel will format it automatically so that it includes a comma for the thousands separator, followed by
two decimal places. It will do the same for negative values, except they will
show up in red. Any zero value will have no currency symbol and will show
two decimal places. If you enter text into a cell, Excel will display the words
No Text Please, regardless of the true underlying text.
Format for
positive values

Format for
negative values

Format for
zero values

Format for
text

$#,##0.00;[Red]$#,##0.00;0.00;"No Text Please"


Figure 2-18. Custom number format sections

It is important to note that formatting a cells value does not affect its underlying true value. For example, type any number into cell A1. Right-click and
go to Format Cells Number Custom, and using any format as a starting
point, type "Hello" (with the quotation marks). Then click OK.
Although the cell displays the word Hello, you can see its true value by
selecting the cell and looking in the Formula bar, or by pressing F2. If you
were to reference this cell in a formulae.g., =A1+20 the result cell would
take on the custom format. If you were to reference cell A1 along with many
other cells that have any standard Excel formate.g., =SUM(A1:A10)the
result cell would still take on the custom format of cell A1. Excel is taking an
educated guess that you want the result cell formatted the same way as the
referenced cell(s). If the referenced cells contain more than one type of format, any custom format will take precedence.
This means you must always remember that Excel uses a cells true value for
calculations, and not its displayed value. This can create surprises when
Excel calculates based on cells that are formatted for no decimal places or
for few decimal places, for instance. To see this in action, enter 1.4 in cell A1
and 1.4 in cell A2, format both cells to show zero decimal places, and then
place =A1+A2 into a cell. The result, of course, is 3, as Excel rounds.
Excel does have an option called Precision as Displayed,
which you can find by selecting the Office button Excel
Options Advanced (pre-2007, go to Tools Options
Calculation), but you should be aware that this option will
permanently change stored values in cells from full precision
(15 digits) to whatever format, including decimal places, is
displayed. In other words, once its been checked and given
the okay, there is no turning back. (You can try, but the
extra precision information is gone for good.)

You might also like