Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Track elapsed hours in Google Sheet

$
0
0

I have a table in Google Sheets that I use to track the time elapsed between a TIME IN and a TIME OUT.

As you can see below, my TOTAL formula in D3 works, calculating the elapsed time from 5 AM to 3 PM as 10 hours. My formula in D5 fails when calculating 7 PM to 2 AM, returning 17 hours instead of the correct elapsed time of 7 hours.

  1. TIME IN and TIME OUT columns are formatted as automatic (time).
  2. The TOTAL column is explicitly formatted as duration [h]:mm:ss
  3. The formula in D3 is
    =ABS(B3-C3)
  4. The formula in D5 is
    =ABS(B5-C5)

Why does the formula in D5 return the wrong number of hours?

A  B  C  D  
1
2TIME INTIME OUTTOTAL
3JIB5:00 AM3:00 PM10:00:00
4DIE000:00:00
5MA7:00 PM2:00 AM17:00:00

enter image description here


Viewing all articles
Browse latest Browse all 9782

Trending Articles