NaturalDevCR
NaturalDevCR

Reputation: 852

Count if date is between a list of date ranges - Google Sheets

i'm wondering how to make a formula work to count the times a specific date is between a range of dates but in a list of ranges in google sheets, i'll try to explain this below:

In cell A1 i have a formated date ( the date i want to find between a range of dates), the range of dates are setup as follows: Start Date: E1 | End Date: G1

So if A1 is between E1 and G1 i need it to be counted, but also i need to count if A1 is between E2 and G2, and then between E3 and G3, and so on (a list of date ranges)

I'm not sure if this is posible, and really hope you understand what i'm trying to do.

PD: I tried something like this, but with no luck:

=COUNTIFS(A1; ">="&E1:E100; A1; "<="&G1:G100)

PD2: Link to sheet with example of how i need the formula to work:

https://docs.google.com/spreadsheets/d/1txw0tqo_XrwC5o3QSNSZynsZzIFuf1-xqgQlurUiL00/edit?usp=sharing

Upvotes: 2

Views: 6492

Answers (1)

player0
player0

Reputation: 1

try:

=ARRAYFORMULA(SUM(IF((A1>=E1:E)*(A1<=G1:G); 1; 0)))

0

Upvotes: 3

Related Questions