Count between 2 lookup values

littlefish71

New Member
Joined
Mar 27, 2013
Messages
4
Hi there,

I have a table which is a shift roster. I would like to enter 2 dates as lookup values and count the number of days the person is "OFF" between those dates. The dates need to be changed so cell reference is not an option. Can someone help?


1/01/2017 OFF
2/01/2017 OFF
3/01/2017 OFF
4/01/2017 D1
5/01/2017 D2
6/01/2017 N1
7/01/2017 N2
8/01/2017 OFF
9/01/2017 OFF
10/01/2017 OFF
11/01/2017 OFF
12/01/2017 D1
13/01/2017 D2
14/01/2017 N1
15/01/2017 N2
16/01/2017 OFF
17/01/2017 OFF
18/01/2017 OFF
19/01/2017 OFF
20/01/2017 D1
21/01/2017 D2
22/01/2017 N1
23/01/2017 N2
24/01/2017 OFF
25/01/2017 OFF
26/01/2017 OFF
27/01/2017 OFF
28/01/2017 D1
29/01/2017 D2
30/01/2017 N1
31/01/2017 N2
1/02/2017 OFF
2/02/2017 OFF
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Try COUNTIFS

Something like

=COUNTIFS(A$2:A$200,">="&D2,A$2:A$200,"<="&E2,B$2:B$200,"OFF")

where
D2 = start date
E2 = end date

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

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