ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   time-clock calculation (https://www.excelbanter.com/excel-worksheet-functions/5255-time-clock-calculation.html)

dokliver

time-clock calculation
 
I am attempting to do a calculation for hours worked using the 24-hour format
but have run into a problem. A simple minus calculation such as (C5-A5)
does not yield an accurate calculation if the time value for A5 is greater
than C5. Can you suggest a format/formula to use is my punch out time is
17:00pm and punch in time is 05:00am?

dcronje


=if(c5a5,(c5+1)-a5,c5-a5)


--
dcronje
------------------------------------------------------------------------
dcronje's Profile: http://www.excelforum.com/member.php...fo&userid=5281
View this thread: http://www.excelforum.com/showthread...hreadid=273392


Sandy Mann

Assuming that the 05:00 is the following morning try

=C5-A5+(C5<A5)

or


=MOD(C5-A5,1)


HTH

Sandy
--
to e-mail direct replace @mailintor.com with @tiscali.co.uk

"dokliver" wrote in message
...
I am attempting to do a calculation for hours worked using the 24-hour

format
but have run into a problem. A simple minus calculation such as (C5-A5)
does not yield an accurate calculation if the time value for A5 is greater
than C5. Can you suggest a format/formula to use is my punch out time is
17:00pm and punch in time is 05:00am?





Peo Sjoblom

=MOD(C5-A5,1)

or less cryptic

=C5-A5+(A5C5)

Regards,

Peo Sjoblom

"dokliver" wrote:

I am attempting to do a calculation for hours worked using the 24-hour format
but have run into a problem. A simple minus calculation such as (C5-A5)
does not yield an accurate calculation if the time value for A5 is greater
than C5. Can you suggest a format/formula to use is my punch out time is
17:00pm and punch in time is 05:00am?



All times are GMT +1. The time now is 10:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com