0

First I had to determine per specialty the total percentage of surgeries that started outside the regular working hours or in weekends.

The final line became:

=SUMPRODUCT(((Table1[Start surgery]>TIME(17;0;0))*(WEEKDAY(Table1[Surgery date];2)<=5))+((Table1[Start surgery]<TIME(9;0;0))*(WEEKDAY(Table1[Surgery date];2)<=5))+(WEEKDAY(Table1[Surgery date];2)>=6))

Now I want to sum the total surgery time of these surgerys (outside working hours and in the weekend) in the G column (surgery duration). enter image description here

Help would be very appreciated!

user3755730
  • 27
  • 1
  • 3

1 Answers1

0

Since you already have the SumProduct returning 1's and 0's for the correct slots, you just need to add another criterion of the surgery duration:

=SUMPRODUCT((((Table1[Start surgery]>TIME(17;0;0))*(WEEKDAY(Table1[Surgery date];2)<=5))+((Table1[Start surgery]<TIME(9;0;0))*(WEEKDAY(Table1[Surgery date];2)<=5))+(WEEKDAY(Table1[Surgery date];2)>=6))*(Table1[Surgery duration]))
Scott Craner
  • 148,073
  • 10
  • 49
  • 81