COUNTIFS Between 2 Dates (Works with 1 date, but not when there's 2)..

BenGee

Board Regular
Joined
Mar 5, 2016
Messages
195
Here's the formula;
=COUNTIFS('Employee Leave Tracker'!$B$4:$B$100,B8,'Employee Leave Tracker'!$C$4:$C$100,">="&$C$7,'Employee Leave Tracker'!$D$4:$D$100,"<="&$C$7)

Conditions are;
B8 = Name1
C7 = 30/04/2018

'Employee Leave Tracker'!B4 = Name1
'Employee Leave Tracker'!C4 = 30/04/2018
'Employee Leave Tracker'!D4 = 02/05/2018

With the above in mind, I'm convinced my formula should work. But it returns 0.

However, if I change 'Employee Leave Tracker'!D4 to the 30/04/2018, I then get 1.

I'm not really sure why. Does anyone have an idea?

Thanks in advance for your help. This seems so simple so I don't understand why I can't see it.
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
You want the criteria to be:
- Name list matches test name
- start list is less than or equal to test date
- end list is greater than or equal to test date
I'm pretty sure you just need to change the formula to this:
Code:
=COUNTIFS('Employee Leave Tracker'!$B$4:$B$100,B8,'Employee Leave  Tracker'!$C$4:$C$100,"<="&$C$7,'Employee Leave  Tracker'!$D$4:$D$100,">="&$C$7)
Is that something you can work with?
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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