View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joeu2004[_2_] joeu2004[_2_] is offline
external usenet poster
 
Posts: 829
Default Curious general format rounding

"Walter Briscoe" wrote:
I have a couple of cells. Each has General format and is empty.
I write "1.5" to both. In one case the cell is bold and the
value is rendered as "2". If I remove bold, the value is
rendered as "1.5".

[....]
Ah ha. It is a question of room to fit the value.

[....]
It is documented in <http://support.microsoft.com/kb/182197


You seem to have answered your own question. As you note, with the General
format, the format of the number (and its rounded appearance) depends only
on the width of the column, not the font style (e.g. bold).

The article neglects to mention that under some conditions, the value will
be displayed in Scientific form, e.g. 1.23E-12. In part, that depends on
cell width. But even if a General-formatted cell is wide enough, Excel will
format only up to 10 or 11 significant digits in Number form (e.g. 1.23),
depending on whether or not the value is an integer.

Some other heuristics might also apply, especially when the value is close
to zero. I have never seen any documentation on these details.

Also, the article is incomplete in its description of the Precision As
Displayed calculation option (PAD).

Unlike other numeric formats, it is true that PAD does __not__ round
General-formatted values to their displayed precision, as the article
explains.

However, PAD __does__ round General-formatted values to 15 significant
digits.

Consider the difference in the MATCH result in the following, with and
without setting PAD and with all cells formatted as General:

A1: 1.15
B1: =3*A1
C1: 3.45
D1: =MATCH(B1,C1,0)