Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Problems losing changes in shared workbook | Excel Worksheet Functions | |||
Not sure what to call these problems ... | Excel Discussion (Misc queries) | |||
I'm getting mad - I'm having problems with EXCEL file name length | Excel Discussion (Misc queries) | |||
Excel 2003 performance problems | Excel Discussion (Misc queries) | |||
"Problems during load" | Excel Discussion (Misc queries) |