Countif for Dates

0

I need a formula for excel that says to countif (G3 >= BK (which is a date) and < BL3 (which is another date.

Countif the cell is equal to or greater than a cell, but less than another date(trying to count dates that are within the week of the first date, which begins on a Monday...

Tina

Posted 2018-08-28T22:01:20.507

Reputation: 11

I think what you need is COUNTIFS – cybernetic.nomad – 2018-08-28T22:05:44.023

=COUNTIF(G3,">=$BK$3,"&">$BL$3") I only want one count. I'm not trying to get multiple counts if the cell falls within the week. I only want one count. – Tina – 2018-08-28T22:07:47.593

Countif usually uses a range of cells not a single cell. with a single cell I would use AND: =AND(G3>=$BK$3,G3<$BL$3) which return TRUE/FALSE – Scott Craner – 2018-08-28T22:10:26.410

That won't work. I don't need false or true. I'm actually looking for a way to count if it is within the range and not count otherwise. – Tina – 2018-08-28T22:21:48.710

So you want 1 or 0? because one cell would return either 1 or 0. – Scott Craner – 2018-08-28T22:24:33.310

Yes. I want it to return a 1 or 0 – Tina – 2018-08-28T22:25:38.393

1=--(AND(G3>=$BK$3,G3<$BL$3)) will return 1 or 0 – Scott Craner – 2018-08-28T22:26:36.700

Not sure what I'm missing but it's returning a 0 as if it's false, but it's actually a true statement. – Tina – 2018-08-28T22:30:03.400

Scott, it works. I had the work cell in the formula. Thanks a lot! – Tina – 2018-08-28T22:31:25.373

Answers

-1

You can try this way because, Countif/Countifs needs Range of cells to evaluate:

=COUNTIFS(A2:A25,">="&B1,A2:A25,"<="&B2)

Note, Cell B1 & B2 contains Date value.

Or if you want to check G3 for two Date values then it should be,

=AND(G3>=$K$3,G3<$BL$3)

This will return TRUE if G3 >= K3 or return FALSE.

Or

=IF(AND(G3>=$K$3,G3<$BL$3),1,2)

This will return 1 if G3 is >= K3 otherwise return 2.

Adjust cell references in the formula as needed.

Rajesh S

Posted 2018-08-28T22:01:20.507

Reputation: 6 800

What is wrong with the answer !! – Rajesh S – 2018-08-30T12:08:17.347