#1   Report Post  
Posted to microsoft.public.excel.misc
Steven_Archer
 
Posts: n/a
Default 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!

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

  #2   Report Post  
Posted to microsoft.public.excel.misc
JMay
 
Posts: n/a
Default 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!

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



  #3   Report Post  
Posted to microsoft.public.excel.misc
Steven_Archer
 
Posts: n/a
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.misc
JMay
 
Posts: n/a
Default 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



  #5   Report Post  
Posted to microsoft.public.excel.misc
Jerry W. Lewis
 
Posts: n/a
Default 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!

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!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems losing changes in shared workbook ACraig Excel Worksheet Functions 0 November 16th 05 03:02 PM
Not sure what to call these problems ... Sweetpea Excel Discussion (Misc queries) 2 November 9th 05 07:31 AM
I'm getting mad - I'm having problems with EXCEL file name length Raffa Excel Discussion (Misc queries) 2 October 3rd 05 07:56 AM
Excel 2003 performance problems bjarvis Excel Discussion (Misc queries) 0 September 28th 05 08:27 PM
"Problems during load" Vincent Excel Discussion (Misc queries) 1 January 19th 05 08:38 PM


All times are GMT +1. The time now is 04:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"