Using DATEDIF() to find number of days between today and another date

Hi, I’m trying to use calc to find the number of days between today, and a date.
Trying =DATEDIF(TODAY(),1/8/22,d). It gives me error 502 which I gather means the arguments are incorrect. I don’t get what I’m doing wrong.
Thanks in advance :slight_smile:

1/8/22 is “one divided by eight divided by twenty-two”, not a date. If you need a date, you may use an ISO string ("2022-01-08" or "2022-08-01", allowing to describe the date unambiguously, not that “format” where it’s unclear which year it is (1922? 2122?), nor month or day (was it Aug 1st, or Jan 8th?)).

d is something undefined (is it part of a cell reference, like d1?). The function expects a string here, like "d".

=DATEDIF(TODAY();"2022-08-01";"d")

2 Likes

Thanks for the quick reply and in depth answer! That helps loads

1 Like

=DATEDIF("2022-01-08";TODAY();"d")
DATEDIF(Start date; End date; Interval)

End date is the date until the calculation is carried out. End date must be later, than Start date.

I meant this date in the UK format, which is d/m/y. But thanks :+1:

Then it’s the other way around. @mikekaganski guessed it. So you don’t have to guess, you need ISO format.

You did not hit F1. This is mentioned in the help files for every date function.

1 Like