How to Calculate Days Between Dates in Google Sheets

Google Sheets - NetworkDays function

One of the most common uses for Google Sheets is to create calendars and to handle information about dates, such as timesheets or vacation schedules. Many users who create a spreadsheet dealing with dates find themselves needing to calculate how many days there are between two dates; that is, they need to find how many days there are between (as an example) July 1, 2018, and January 31, 2019.

You could just look on a calendar and count the days up by hand, and that would work fine if the dates were very close together, but for large numbers of dates or dates that are far apart, a little help from the computer would sure be nice. Fortunately, Google Sheets has a number of ways to find the number of days between two dates.

Let’s take a look at the functions you can use to calculate days between dates in Google Sheets.

How to Calculate Days Between Dates in Google Sheets

Before getting started, it’s important to note that these methods only work when using the American date format. If you’re not in the United States, you can go into Google Sheets and change your Locale and Time Zone if you want to use these methods.

That being said, let’s take a look at how to find the number of days between two dates in Google Sheets.

How to Calculate Days Between Dates in Google Sheets using the MINUS Function

Unlike Excel, Google Sheets has a subtraction function which is very handy for calculating simple date differences. MINUS is Sheets’ subtraction function and, because of the way dates are stored internally (as integers describing the number of days since a certain date in the past), it works just fine for deducting one date from another. That is, as long as the dates are both in the same format. The syntax for MINUS is: =MINUS(value 1, value 2).

  1. Open a blank Google Sheets spreadsheet in your browser and enter (as an example) ‘4/5/2017‘ and ‘5/15/2017‘ in cells B3 and C3. Google Sheets - Date values
  2. Now, select cell D3, which is where we’ll put the MINUS function. Click inside the ‘fx’ bar, and then input ‘=MINUS(C3, B3)‘ and press Enter. Cell D3 will now return the value 40, as shown directly below.

google dates

This means there are 40 days between 4/5/2017 and 5/15/2017.

You can also find the difference between the dates just by entering the cell references and not bothering with the MINUS function.

  1. For example, click cell E3 and input ‘=C3-B3‘ in the function bar, as shown in the snapshot directly below. That will also return 40. Although, since you are directly subtracting dates without MINUS, the value in cell E will probably display in date format and look very strange.

You can convert the cell format to show an integer value by selecting Format > Number and Number.

google dates2

You might also input the cell references with the earlier date first. If you entered ‘=B3-C3’ in the function bar, the cell would contain the value -40. This highlights that 4/4/2017 is 40 days behind 5/15/2017.

How to Calculate Days Between Dates in Google Sheets using the DATEDIF Function

DATEDIF is a function that helps you find the total days, months, or years between two dates. You can find the total days between two dates entered on the spreadsheet or include the dates within DATEDIF instead.

The syntax for DATEDIF is:

DATEDIF(start_date, end_date, unit). The unit for the function can be D (days), M (months) or Y (years).

  1. To find the difference between 4/4/2017 and 5/15/2017 with DATEDIF, you should select a cell to add the function to (F3, in our case) and input ‘=DATEDIF(B3, C3, “D”)‘ in the ‘fx’ bar.

google dates3

DATEDIF will also work if you put the date information directly into the formula.

  1. Click a spreadsheet cell to add DATEDIF to, and then input ‘=DATEDIF(“4/5/2017”, “5/15/2017″,”D”)’ in the fx bar.

google dates4

As you can see, the results are the same.

How to Calculate Days Between Dates in Google Sheets using the DAYS360 Function

Google Sheets includes DAY360, which calculates the difference between dates for a 360-day year. The 360-day calendar is used primarily for financial spreadsheets in which interest rate calculations might be required.

The syntax for DAYS360 is:

=DAYS360(start_date, end_date, [method]). The [method] is an optional indicator you can include for the day count method.

  1. As an example, enter ‘1/1/2016‘ in cell B4 as the start date, and then input ‘1/1/2017‘ in C4 as the end date for the function. Google Sheets - Date values 2
  2. Now, select cell D4, input the function ‘=DAYS360(B4, C4)‘ in the ‘fx’ bar and press Enter.

google dates5

Cell D4 will include a total of 360 days between the selected dates. Note that the only real use for this particular function is if you are working with interest rates.

How to Calculate Days Between Dates in Google Sheets using the NETWORKDAYS Function

NETWORKDAYS also calculates the number of days between dates, but it’s not entirely the same as the others. This function only counts the weekdays, so it leaves weekends out of the equation. (Read it as “Net Workdays” rather than “Network Days”.)

As such, you can find the total number of weekdays between a couple of dates with NETWORKDAYS, and you can also specify extra holidays so that it excludes other dates.

The syntax for NETWORKDAYS is:

NETWORKDAYS(start_date, end_date, [holidays]).

  1. Using dates from the previous example, 4/4/2017 and 5/15/2017 entered in cells B3 and C3. Google Sheets - Date values
  2. Select a cell and input ‘=NETWORKDAYS(B3, C3)‘ and press the EnterGoogle Sheets NetworkDays Function
  3. To add a holiday date to the function, first, enter ‘4/17/2017‘ in cell A3, and then modify the function by adding the cell reference A3 to it. So, the function would then be ‘=NETWORKDAYS(B3, C3, A3),’ which will return 28 with the extra bank holiday also deducted from the total days.

google dates6

Other Important Date-Related Functions

There are a number of date-related functions in Sheets that you should be familiar with if you are going to be doing a lot of work with dates.

  • The DATE function converts a provided year, month, and day into a date. The format is DATE(year,month,day). For example, DATE(2019,12,25) returns “12/25/2019”.
  •  The DATEVALUE function converts a properly-formatted date string into a date integer. The format is DATEVALUE(date string); the date string can be any appropriate string, such as “12/25/2019” or “1/23/2012 8:5:30”.
  • The DAY function returns the day of the month that a specific date falls on, in numeric format. The format is DAY(date). For example, DAY(“12/25/2019”) returns 25.
  • The DAYS function returns the number of days between two dates. The format is DAYS (end date, start date). For example, DAYS(“12/25/20189”, “8/31/2019”) returns 116.
  • The EDATE function returns a date a specific number of months before or after the given date. The format is EDATE(start date, number of months). For example, EDATE(“8/31/2019”, -1) returns “7/31/2019”.
  • The MONTH function returns the month of the year that a specific date falls on, in numeric format. The format is MONTH(date). For example, MONTH(“8/30/2019”) returns 8.
  • The TODAY function returns the current date as a date value. The format is TODAY(). For example, at the time of this writing, TODAY() would return “8/31/2019”.
  • The WEEKDAY function returns a numeric value showing the day of the week of the date provided. The format is WEEKDAY(date, type) and type can be 1, 2, or 3. If type is 1, days are counted from Sunday and Sunday has a value of 1. If type is 2, days are counted from Monday and the value of Monday is 1. If type is 3, days are counted from Monday and the value of Monday is 0. For example, 4/30/2019 is a Tuesday, and WEEKDAY(“4/30/2019”,1) would return 3, while WEEKDAY(“4/30/2019”,2) would return 2 and WEEKDAY(“4/30/2019”,3) would return 1.
  • The YEAR function returns a numeric value showing the year of the date provided. The format is YEAR(date). For example, YEAR(“12/25/2019”) would return 2019.

Calculate the Day Away

Google Sheets is an incredibly powerful program, especially for an application that’s completely free. While it may not be quite as powerful as something like Microsoft Excel, it can still handle a wide range of tasks, including this one.

13 thoughts on “How to Calculate Days Between Dates in Google Sheets”

Susan says:
if I get a -value how can I set to 0 days late
Tonya says:
Hello,
Is there a way to reflect the years, months, and days between two different dated columns in one cell? I see the YM, Y, and YD, but I do not see a YMD formula. IE: 1 year, 2 months, and 4 days between the date in cell R2, and cell S2.
Thanks!
Tonya
Em says:
Is there a way I can have the cell tell me how many weeks from a specific date in a cell to current date? So it would continuously change based on the current date?
marwin cayanan says:
Is there any way I can show a result where it shows [number of years:numbers of months:number of days] in one cell?
siren says:
This is the formula used to see year/months/days between dates. Obviously the cells should be changed to where the dates are in your own sheet.
=DATEDIF(C1,D1,”y”)&” years ” &DATEDIF(C1,D1,”ym”)&” months “&DATEDIF(C1,D1,”md”)&” days”
exp says:
Once can use YEARFRAC function to get date difference in years in decimals. eg 0.5 Yr
rancher Mike says:
Thank you for the nice tutorial. Can you tell me how I can apply the date calculation to all rows in columns? For example each row column c has a date, and each row column d has a date. I want it to calculate the days from the dates in each row in column c through the dates in each row in column d and show totals days in column e.
Thank you
P.S. I am using this to calculate the number of days livestock have been grazing in paddocks.
Sudev Barar says:
use in conjunction with ARRAYFORMULA
Amr ALHOSSARY says:
This is not always useful. The week in Egypt and most (if not all) Arab countries, starts on Saturday.
Daniel says:
How would this work if i’m trying to conditional format a cell to a) highlight green for dates between today and 3 months ago b) highlight yellow for dates between 3 months and 6 months ago and on?
B says:
For anyone struggling to get this to work you must use the Americanised date format of month-date-year. Took me some time to work out what the problem was since for those of us outside the American-centric thought bubble, it didn’t even occur that this might be a strict requirement.
Rico says:
If you first go to File > Spreadsheet settings and change the Locale (and Time zone if appropriate) this will make life much easier ie you won’t have to convert to US date format. Although you’ll likely have to change the existing US date formats you have dates back to the format you want to use.
Jonathan says:
Very helpful – thank you!
naresh says:
Could Anyone tell Which Date function will work for finding dates array inbetween start Date and End Date
Adam Steinfurth says:
The DAYS functions can do this, right?

Leave a Reply

Your email address will not be published.


Disclaimer: Some pages on this site may include an affiliate link. This does not effect our editorial in any way.

Todays Highlights
How to See Google Search History
how to download photos from google photos