Reputation: 151
Excel question
Two columns and want to count the cells in column 2 if they are between two chosen dates in column 1
column 1 column 2
Date of order order id
11/11/2008 4361
12/11/2008 4363
13/11/2008 4368
14/11/2008 4333
15/11/2008 4222
16/11/2008 4893
17/11/2008 4872
13/11/2008 4368
14/11/2008 4333
15/11/2008 4222
16/11/2008 4893
17/11/2008 4872
Upvotes: 0
Views: 1025
Reputation: 152505
Try this:
=COUNT(INDEX(B:B,MATCH("11/11/2008",A:A)):INDEX(B:B,MATCH("15/11/2008",A:A))
You can change the dates to cell references that contain the first and last date. Column A must be sorted.
Your local setting may require the tha ,
delimiter be ;
instead. If so replace all the ,
with ;
Upvotes: 1
Reputation: 151
Could this be achieved easier with a helper column? Assuming both columns are fully populated, is there a way to place a "1" in column 3 if an orderID lays within 2 date ranges?
Upvotes: 0
Reputation: 2167
Please consider using the following formula:
=COUNTIFS($A:$A,">="&StartDate,$A:$A,"<="&EndDate)
Note that this assumes that column 2 has all rows populated. Regards,
Upvotes: 0