View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default TRUNC zero giving odd results?

That is correct if you want to truncate the total, but if you want to
truncate each, use

=SUM(TRUNC(D31:D35))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

wrote in message
ups.com...
Hi
We use excel as a timerecording sheet whereby 7 hours and 30 minutes is
entered as 7.3
In order to ensure some of the calcs are correct we use TRUNC to add
the hours & minutes separately. (ie: We Sum the TRUNC part & add it to
(Sum of everything - sum TRUNC part))
I have the following in a spreadsheet

Cell ref
D31: 7.3
D32: 7.3
D33: 7.3
D34: 7.3
D35: 0

The numbers above represent 7 hours 30 minutes for 4 days out of the 5.
The total hours should be 30 (I have to add the .3 bit separately &
convert to minutes then hours..)
But my formula appears to be unstuck at the first hurdle:

But when I run (TRUNC(SUM(D31:D35))) I get 29 and not 28. Why?

Incidentally is there an easier way to add times entered as hours &
minutes rather than having complicated formulaes (I am amending a
spreadsheet developed by somebody else)

Cheers