Sumifs Hours Worked Between Two Dates and Times with Multiple Criteria

bradyman97

Board Regular
Joined
Feb 22, 2008
Messages
60
Office Version
  1. 2019
Below is a small sample of my spreadsheet. I'm trying to come up with a formula that adds the total hours worked between two dates, and the times are between 2200 and 0600, and if my code is Overtime 1.5. Formula result should be 16 hours.


(A1) Start Date "01/01/2024"
(A2) End Date "01/04/2024"
(A3) Code Name "Overtime 1.5"
(C1) Total Hours for the Code


DATERATECODESTARTENDTOTAL HOURS
01/01/202433.67Normal Hours14:0022:008.00
01/01/202450.51Overtime 1.522:0006:008.00
01/02/202433.67Normal Hours14:0022:008.00
01/03/202450.51Overtime 1.506:0014:008.00
01/03/202433.67Normal Hours14:0022:008.00
01/04/202433.67Normal Hours14:0022:008.00
01/04/202450.51Overtime 1.522:0006:008.00



Thank you for your time
 
If you convert col D to numbers & expand the number of decimals visible you will see that you have the wrong value
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
If you convert col D to numbers & expand the number of decimals visible you will see that you have the wrong value

How does that happen when i have 22:00 (format Time) in the cell and it says 10:00:00 PM in the formula bar
 
Upvote 0
Time is just a special type of cell format & does not change/affect the actual value in the cell.
 
Upvote 0
Glad it's sorted & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,880
Messages
6,175,154
Members
452,615
Latest member
bogeys2birdies

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