Home > Back-end >  How to express a range of dates in an excel function?
How to express a range of dates in an excel function?

Time:02-01

I'm tracking time spent on different things in a given month, here is the table.

enter image description here

Lets say I want to count up how many times I spent time on a in February.

I tried it with this ...

=countifs(B6:B55;"a";A6:A55; "2022-01-31"<"2022-03-01")

... and ...

=countifs(B6:B55;"a";A6:A55; MAX(2022-3-1)-MIN(2022-1-31))

... but it didn't work.

basically I'm trying to figure out how to display a range of dates for example from 2022-01-31 to 2022-03-01 so it can lets say, count up the times of a

The output of the countifs function should be 14, because an "a" appears 14 time in the span of 2022-01-31 to 2022-03-1

CodePudding user response:

You need to separate the date portion into two separate count and criterias ranges (one for the lower range and one for the upper).

=countifs(B6:B55,"a",A6:A55,">=2022-02-01",A6:A55,"<=2022-02-28")

  •  Tags:  
  • Related