How to Calculate the Number Days Between Two Dates in Google Sheets


If you're trying to calculate the amount of time between two dates, there's an easy way to do that in Google Sheets via the =DATEDIF() formula. To use it, you just need the start_date, the end_date, and the unit of time (days, months, or years)

For example, here's how you would calculate the number of days between two dates: =DATEDIF($B$1,$B$2, "D"). To calculate the months or years, just change out the 3rd parameter to "M" or "Y".

datediff

If you need weeks, just take the number of days and divide it by 7. Like so: =DATEDIF($B$1,$B$2, "D") / 7. You'll probably get a nasty decimal though. To clean that up, wrap it up in a ROUNDDOWN() formula, like this:

datediff-week

Common Use Cases


  • Measure time deltas between the start date of a task and the end date of a task
  • Figure out how many days as left until your project's deadline
  • Create a dynamic countdown