Trying to add hours with multiple variable in between 2 dates

Jennifer4Dillon

New Member
Joined
Jul 23, 2021
Messages
2
Office Version
  1. 2007
Platform
  1. Windows
Trying to sum hours for employees. Need to sum by person, in between 2 dates and adding 3 categories. Tried to use sumif and if combined, but haven't been able to get the formula to work. I have other areas of the time sheet that only had one category that I was able to use the sumif. =SUMIFS('Raw Logs'!$E$2:$E$39,'Raw Logs'!$F$2:$F$39,">="&$C3,'Raw Logs'!$F$2:$F$39,"<="&$D3,'Raw Logs'!$C$2:$C$39,"int-9",'Raw Logs'!$H$2:$H$39,$B3)

But when I needed to do INT-1, INT-14 and INT-15, I can't get the formula to work, I have tried combining with IF but couldn't not get to work without error. If I just use another sumif, the total is too high and it just adds it instead of using it as another criteria. I would really appreciate if something was able to help. Thank you.

1627087284227.png
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi Jennifer4Dillon,

Could you explain what "INT-1, INT-14 and INT-15" means?
Can you give a worked example with your expected results?
 
Upvote 0
sorry yes, those another criteria (They are vacation hours, sick hours and holiday hours). They are what they client has named the different types of hours from another sheet in the workbook. I need to sum those types of hours if they fall between the date range and they are the correct sales person. If Match C3 and between D4 and E4, and then sum them by using the criteria.

I have ended up using a workaround by adding 3 columns to the 1st spreadsheet and then summing them and hiding them, but I am very frustrated that I couldn't figure it out. this is the formula I used that worked with one of them, but I couldn't make it work with 3. also here is a screen shot of the 2 sheet. =SUMIFS('Raw Logs'!$E:$E,'Raw Logs'!$F:$F,">="&$C4,'Raw Logs'!$F:$F,"<="&$D4,'Raw Logs'!$C:$C,"int-1",'Raw Logs'!$H:$H,$B4)

1627562469792.png
 
Upvote 0
Hi Jennifer4Dillon,

A few comments:
  1. The two screenshots don't match in terms of numbers so I've created my own.
  2. I would prefer not to hard code the INT-nn into formulae so I'm using row 1 (which could be hidden). You don't say what each INT code is so I guessed.
  3. I am generous, so gave Employees 5th July as a holiday.
  4. I assumed "Logged" was all INT codes so just used the wildcard asterisk.
  5. Take note when checking a date which includes time. Your ""<="&$D4" would look for entries up to 31 July 2021 at 00:00 but Excel holds times as a fraction of a day so I've added 0.999988 which will search up to 31 July 2021 at 23:59:59.

So here's my example Raw Logs

Jennifer4Dillon.xlsx
ABCDEFGH
1INTHoursDateEmployee
2INT-187/2/2021 10:00Bob
3INT-187/9/2021 10:00Bob
4INT-187/15/2021 8:00Phil
5INT-187/16/2021 8:00Jerry
6INT-187/9/2021 14:10Bob
7INT-1037/2/2021 8:45Jerry
8INT-1217/13/2021 12:30Jerry
9INT-1317/2/2021 10:00Phil
10INT-1487/9/2021 10:00Jerry
11INT-1487/15/2021 8:00Bob
12INT-1817/16/2021 8:00Jerry
13INT-217/9/2021 14:10Bob
14INT-217/2/2021 8:45Bob
15INT-417/13/2021 12:30Jerry
16INT-417/2/2021 10:00Phil
17INT-417/9/2021 10:00Bob
18INT-417/15/2021 8:00Jerry
19INT-1217/16/2021 8:00Jerry
20INT-417/9/2021 14:10Phil
21INT-417/2/2021 8:45Bob
22INT-617/13/2021 12:30Jerry
Raw Logs


And here's my report screen

Jennifer4Dillon.xlsx
ABCDEFGHIJKLM
1*INT-13INT-1INT-14INT-15Holidays
2EmployeeDate StartDate EndExpectedLoggedProductionInternalPTOSales7/5/2021
3Jerry7/1/20217/31/2021168250880
4Bob7/1/20217/31/20211683602480
5Phil7/1/20217/31/2021168111800
6
7
8
Report
Cell Formulas
RangeFormula
E3:E5E3=NETWORKDAYS(C3,D3,$M$2:$M$17)*8
F3:J5F3=SUMIFS('Raw Logs'!$E:$E,'Raw Logs'!$F:$F,">="&$C3,'Raw Logs'!$F:$F,"<="&$D3+0.999988,'Raw Logs'!$C:$C,F$1,'Raw Logs'!$H:$H,$B3)
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,289
Members
449,077
Latest member
Rkmenon

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