1
votes

Here's my sample data:

Column A   |   Column B    | Column C

      ID   |   Date_Range  |  Description
      01   |   28-Nov-18   |  NOV
      02   |   29-Nov-18   |  NOV
      03   |   30-Nov-18   |  NOV
      04   |   01-Jan-19   |  JAN

And I have 2 cells to input my preferred date range

Date from: __________ <---Cell A2

Date to: ____________ <----Cell B2

Output:____________ <--- Cell C2

As you can see there are 3 rows for the month of November

and 1 row for January. In addition, I have 3 cells. A2 for Date from, B2 for Date to and C2 where the output shows.

What I'm trying to do is, When I try to input my preferred date range For example

Date From: 28-Nov-18 Date To: 28-Nov18

The output should count how many Date are under to the date ranges. Output: 3

1

1 Answers

1
votes

Use COUNTIFS with >= and <= operators and the ampersand & to count dates that fall within a date range.

=COUNTIFS(B5:B8,">="&A2,B5:B8,"<="&B2)

enter image description here