ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   problems with TRUNC (https://www.excelbanter.com/excel-discussion-misc-queries/56921-problems-trunc.html)

Steven_Archer

problems with TRUNC
 

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 give
the incorrect answer...but all the settings are the same as the one
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!


--
Steven_Archer
------------------------------------------------------------------------
Steven_Archer's Profile: http://www.excelforum.com/member.php...o&userid=29025
View this thread: http://www.excelforum.com/showthread...hreadid=487564


JMay

problems with TRUNC
 
alter to:
=TRUNC((W152/60),0)


"Steven_Archer"
wrote in message
news:Steven_Archer.1yy4ha_1132743008.4391@excelfor um-nospam.com...

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 give
the incorrect answer...but all the settings are the same as the one
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!


--
Steven_Archer
------------------------------------------------------------------------
Steven_Archer's Profile:
http://www.excelforum.com/member.php...o&userid=29025
View this thread: http://www.excelforum.com/showthread...hreadid=487564




Steven_Archer

problems with TRUNC
 

Hi,

Thanks for the swift reply


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

The figure is meant to show whole hours so either '1', '2','3' etc


--
Steven_Archer
------------------------------------------------------------------------
Steven_Archer's Profile: http://www.excelforum.com/member.php...o&userid=29025
View this thread: http://www.excelforum.com/showthread...hreadid=487564


JMay

problems with TRUNC
 
Trunc() whacks off any trailing decimals, so Trunc(2.9999999,0) = 2

Re-Format your cells to 0 decimal places.

HTH

"Steven_Archer"
wrote in message
news:Steven_Archer.1yy5va_1132744801.7245@excelfor um-nospam.com...

Hi,

Thanks for the swift reply


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

The figure is meant to show whole hours so either '1', '2','3' etc


--
Steven_Archer
------------------------------------------------------------------------
Steven_Archer's Profile:
http://www.excelforum.com/member.php...o&userid=29025
View this thread: http://www.excelforum.com/showthread...hreadid=487564




Jerry W. Lewis

problems with TRUNC
 
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/micro...fb95785d1eaff5
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

Steven_Archer wrote:

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 give
the incorrect answer...but all the settings are the same as the one
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!




All times are GMT +1. The time now is 08:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com