problems with TRUNC

  • Thread starter Thread starter Steven_Archer
  • Start date Start date
S

Steven_Archer

Hi,

I seem to be having trouble with the TRUNC formula!

In the same worksheet i have used it many times but some seem to giv
the incorrect answer...but all the settings are the same as the on
that works! :confused:

the formula is *=TRUNC(W152/60)*

where in this case W152 is 180.

in some of the cells the result of =TRUNC(180/60) = 3

in the ones which are not working the result is 2.9999999999999

Any ideas? all the formulas and cell settings are identical
 
Hi,

Thanks for the swift reply


It still doesnt seem to be working. When i run the formula evalutatio
the result appears as '2.999999' again but this then shows in the cel
as 2.

The figure is meant to show whole hours so either '1', '2','3' et
 
The value in W152 is not 180, it is something like
179.9999999999996
but since Excel will display no more that 15 digits (see Help for
Specifications), you cannot directly see the difference from 180.
However, you can use the VBA code at
http://groups.google.com/group/microsoft.public.excel/msg/6efb95785d1eaff5
to see more than 15 digits of what is in W152.

Since you cannot enter more than 15 digits, W152 must either contain a
formula or else be pasted as a value from a formula.

If you post the formula and its inputs, I can be more specific about why
the value is what it is instead of what you expected.

=TRUNC(W152/60+1E-13)
may do no violence to your intent, while adjusting for small differences
like this.

Jerry
 

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

Back
Top