ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   calculate hours (https://www.excelbanter.com/excel-discussion-misc-queries/91102-calculate-hours.html)

Caveman

calculate hours
 

Hi
I have a spreadsheet formated custom hh:mm in cells A2:A6, A2 is the
start time (1am), A3 is a break (45mins) taken at 3.45am, A4 is a break
(1hour) taken at 5.15am, A5 is my finish time 1445pm, I get extra £3.00
an hour for hours worked between 18:00 and 06:00. A6 is total hors
worked. I want another cell (A7) to show how many hours were worked
between 18:00 and 06:00. Calculation can show with breaks out or
included, or both.
Many Thanks
Caveman


--
Caveman
------------------------------------------------------------------------
Caveman's Profile: http://www.excelforum.com/member.php...o&userid=27546
View this thread: http://www.excelforum.com/showthread...hreadid=546484


Fred Smith

calculate hours
 
Try something like this:

a7 =min(a5,time(6,0,0))-if(a2<a5,a2,max(a2,time(18,0,0))-1)

This will calculate the total time worked between 18h00 and 6h00, including
breaks.

To subtract the breaks, you would deduct:

=if(and(a3time(5,15,0),a3<time(6,0,0)),time(6,0,0 )-a3,0)+if(and(a4time(5,0,0),a4<time(6,0,0)),time(6 ,0,0)-a4,0)

Hope this helps.

--
Regards,
Fred


"Caveman" wrote in message
...

Hi
I have a spreadsheet formated custom hh:mm in cells A2:A6, A2 is the
start time (1am), A3 is a break (45mins) taken at 3.45am, A4 is a break
(1hour) taken at 5.15am, A5 is my finish time 1445pm, I get extra £3.00
an hour for hours worked between 18:00 and 06:00. A6 is total hors
worked. I want another cell (A7) to show how many hours were worked
between 18:00 and 06:00. Calculation can show with breaks out or
included, or both.
Many Thanks
Caveman


--
Caveman
------------------------------------------------------------------------
Caveman's Profile:
http://www.excelforum.com/member.php...o&userid=27546
View this thread: http://www.excelforum.com/showthread...hreadid=546484





All times are GMT +1. The time now is 07:21 AM.

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