View Single Post
  #7   Report Post  
Dave Peterson
 
Posts: n/a
Default

Ah, an hour is 1/24 of a day.

Since you added 24 to your formula, it added 23 extra days.

if(from <= until;until-from;1-from+until)

should work ok.



Bruno Lauwers wrote:

No dates, if I chance the hours, so there are no overnight calculations (with
the false-statement), then everything is correct.

In Belgium we use u instead of h for the hour("uur" in belgian).

"Dave Peterson" wrote:

It appears to be off by 23 days.

Any chance you have a date in one of those cells (maybe both), instead of just
times. (Select each cell and look at the formula bar.)

ps. In the USA version of excel, we use: [h]:mm



Bruno Lauwers wrote:

I made a spreadsheet calculating how long a user is on line(VPN)
From until = total time
Because this can go overnight, I make the sum with an IF-statement.
if(from <= until;until-from;24-from+until)
This works completely correct.
Then I make a sum of all these times, and here it goes wrong.
If there is a sum calculated with the false-statement, then the sum of the
total hours goes completely wrong. As long as every time is calculated with
the true-statement, the total result is correct.

This even goes wrong by making a sum of one cell.
example
from until total
22:58 8:42 9:44

total 561:44

this is the result I get when making a sum of the column total, format as
[u]:mm

Does anyone have a solution for this?


--

Dave Peterson


--

Dave Peterson