Hour of the Day Between Two Time Periods

CJ_15

New Member
Joined
Jan 11, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello - I am looking to determine which hours of the day (not total) were worked between two time periods. In the below example, first row, I am looking for a formula to drag across the hours of the day based on clock in and clock out times, rounded to the nearest quarter of an hour (expressed where 15 mins = 0.25). I manually entered the data shown in yellow/red columns to show what I am looking for the end result to be. I thought the FLOOR function with a nested IF would help me, but I'm having trouble with the logic. Thank you very much for any assistance you can provide.

1610380190398.png


Text form of above screen shot*
STARTDTM.2ENDDTM.1ENDDTM.2Worked Time Hours12 AM - 1 AM1 AM - 2 AM2 AM - 3 AM3 AM - 4 AM4 AM - 5 AM5 AM - 6 AM6 AM - 7 AM7 AM - 8 AM8 AM - 9 AM9 AM - 10 AM10 AM - 11 AM
5:42 PM​
7/1/2020​
10:12 PM​
4.5​
0.25​
1​
1​
1​
1​
0.25​
10:42 PM​
7/1/2020​
11:00 PM​
0.3​
0.3​
11:00 PM​
7/2/2020​
12:00 AM​
1​
12:00 AM​
7/2/2020​
6:00 AM​
6​
1​
1​
1​
1​
1​
1​
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Welcome to MrExcel MessageBoard
if you want to See minutes also you should change Number format at Data that input times.
1. I changed first column to Start time of each column then:
Book1
ABCDEFGHIJKLMNO
1STARTDTM.2ENDDTM.1ENDDTM.2Worked Time Hours12:00:00 AM1:00:00 AM2:00:00 AM3:00:00 AM4:00:00 AM5:00:00 AM6:00:00 AM7:00:00 AM8:00:00 AM9:00:00 AM10:00:00 AM
25:42 PM7/1/202010:12 PM4.50.2511110.25
310:42 PM7/1/202011:00 PM0.30.3
411:00 PM7/2/202012:00 AM0
512:00 AM7/2/20206:00 AM6111111
6
7Criteria 1Criteria 2Sumifs
8For Row27:00:00 AM10:00:00 AM3.25
9For Total7:00:00 AM10:00:00 AM3.55
Sheet1
Cell Formulas
RangeFormula
D2:D5D2=SUM(E2:O2)
D8:D9D8=$L$1
E8:E9E8=$O$1
F8F8=SUMIFS($E$2:$O$2,$E$1:$O$1,">="&$L$1,$E$1:$O$1,"<"&$O$1+1/24)
F9F9=SUMPRODUCT(($E$2:$O$5)*($E$1:$O$1>=D9)*($E$1:$O$1<(E9+1/24)))
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,322
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top