Forum Discussion
COUNTIF with dates
We have students checking in various dates. I have a column of check-in dates and would like to know how many have checked in as of today. Set a cell (D59) for today's date (=TODAY()) and used =COUNTIF(E3:E55,">=D59") and it returns a value of zero. Can I do this with COUNTIF, or is there another function I should use?
Also, can I use the TODAY function in the COUNTIF function instead referring to the other cell? What would that look like? Thanks for your help.
13 Replies
- sunil_dawareCopper Contributor
Hello, markyehl
My understanding of challenge posted here is as follows,
- Student check-in dates are either Past or Today's date.
- Needs to calculate how many total Students are active check in till date.
If my understanding is correct, then formula should be as below, included today function in formula. Also please find attached sample sheet.
Hope this will of help to you.
- PeterBartholomew1Silver Contributor
The way you have coded the formula
=COUNTIF(E3:E55,">=D59")
makes the D59 a literal text string and not a cell reference. Try
=COUNTIF(E3:E55,">="&D59)
- markyehlCopper Contributor
Peter and Sergei - thank you so much, it worked.
Is there a way to nest the TODAY function in the COUNTIF argument and not reference cell D59? Just curious.
- SergeiBaklanDiamond Contributor
And if you are on Excel 365 it could be
=SUM(--(E3:E55>=TODAY()) )
Double dash is needed to convert logical TRUE or FALSE into 1 or 0.
- SergeiBaklanDiamond Contributor