SUM(IF greater/equal every other row

Defaced

New Member
Joined
Nov 19, 2015
Messages
26
Hopefully I will explain this well enough to understand outside my brain. I have 2 columns of shift times (Shift Start and Shift End) all on the even rows. Under their shifts is the row that has their Lunch break start/end times. I need to get an interval count of the number of people staffed, but when I used:

{=SUM(IF($A3>=$B$3:$B$100,IF($A3<$C$3:$C$100,1,0),0))}

It includes the lunch shifts and makes my counts inaccurate. Does anyone know of a way to only sum the even rows (shifts) and subtract the even rows (lunches) to get a true count?
 
Last edited:
Got it figured out using COUNTIFS

=COUNTIFS('Schedule'!$A$1:$A$100, "<>" & 'Schedule'!$A$2, Schedule'!$C$1:$C$100, "<=" & A3,'Schedule'!$D$1:$D$100,">" & A3)-COUNTIFS('Schedule'!$A$1:$A$100,"=" & 'Schedule'!$A$2,'Schedule'!$C$1:$C$100,"<=" & A3,'Schedule'!$D$1:$D$100,">" & A3)
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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