Forum Discussion

markyehl's avatar
markyehl
Copper Contributor
Jul 16, 2020

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_daware's avatar
    sunil_daware
    Copper Contributor

    Hello, markyehl 

     

    My understanding of challenge posted here is as follows,

    1. Student check-in dates are either Past or Today's  date.
    2. 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.

     

  • markyehl 

    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)

    • markyehl's avatar
      markyehl
      Copper Contributor

      PeterBartholomew1 

      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.

      • SergeiBaklan's avatar
        SergeiBaklan
        Diamond Contributor

        markyehl 

        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.

Resources