Search code examples
google-sheetsdate-comparison

How to use operands on date values


I have a countdown to the current date using DATEDIF(TODAY(), *The date im counting to in the future*, "d"). I was wondering if there was a way to do an IF() to check if the current date is > the date I'm checking against. I tried (assume the date I'm checking against is A1) IF((A1 <= 0), IF((A1 = 0), "Today", "Done"), DATEDIF(TODAY(), A1, "d")). This should have 3 outputs; "Done", for in the past, "Today", for toady, or else the date difference. I've never really used sheets / excel in this way before and I cant seem to find where the error is. When I use Error.Type(A1) it returns 8. Thanks in advance.


Solution

  • Try:

    =if(A1=today(), "Today", if(A1<today(), "Done", DATEDIF(TODAY(), A1, "d")))
    

    and see if that works for you ?