NumberFormat for small non-zero numbers?

M

maury.markowitz

I have a column that subtracts two other columns and is displayed as currency. If the other two columns are "close", this column shows zero.

Most of the rows will be zero, and it's the non-zeros that are "interesting". So I've put in a NumberFormat to eliminate the zero, so it's a blank.

However, in many cases the number is not zero, but some very small value... 0.0000000000123

Is there anything I can do to make these fall into the zero format as well? I could round it, but is there an easier way?
 
C

Claus Busch

Hi,

Am Mon, 26 Nov 2012 09:30:41 -0800 (PST) schrieb
(e-mail address removed):
Is there anything I can do to make these fall into the zero format as well? I could round it, but is there an easier way?

no, you have to use ROUND


Regards
Claus Busch
 
J

joeu2004

I have a column that subtracts two other columns and
is displayed as currency. If the other two columns are
"close", this column shows zero.
Most of the rows will be zero, and it's the non-zeros
that are "interesting". So I've put in a NumberFormat
to eliminate the zero, so it's a blank.
However, in many cases the number is not zero, but some
very small value... 0.0000000000123
Is there anything I can do to make these fall into the
zero format as well? I could round it, but is there an
easier way?

It would be prudent to explicitly round all currency calculations, even
simple subtractions. For example, =ROUND(A2-A1,2).

That avoids infinitesimal anomalies that arise in Excel arithmetic due to
the way that Excel represents numbers internally (64-bit binary
floating-point).

For example, IF(10.1-10=0.1,TRUE) returns FALSE(!). But
IF(ROUND(10.1-10,2)=0.1,TRUE) returns TRUE as expected.

But if you wish, you might use the following Custom format:
[<0.005]"";$#,##0.00

Note that that works only for non-negative currency values.

The following Custom will also display negative currency values properly:
[<=-0.005]-$#,##0.00;[<0.005]"";$#,##0.00

However, both Custom formats display "-" (without quotes) for negative
values that are intended to displayed as just the null string. (A defect,
IMHO.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top