Number of Days Between Two Dates in Google Sheets

In the Google Sheets, there are number of ways to write a formula to get the number of days between two days. And in this tutorial, we are going to learn all these ways to write formula. So, Let’s get started.

Using Simple Minus Operator

Just like numbers, you can use subtract one date from another to get the total number days between.

number-of-days-between-two-dates
  1. First, enter “=” in a cell.
  2. Now, refer to the Earlier Date.
  3. Then refer to the recent date.
  4. In the end, hit enter to get the result.

In the above example, you can see we have 01-Jan-2023 and 01-feb-2023. And the total number of days between is 31.

=B1-A1

Using Minus Function

Apart from this, you can also use the MINUS function which can be used in the same way.

number-of-days-using-minus-function

Specify the end date in the in the first argument, and then start date in the second argument.

=MINUS(B1,A1)

Both formulas which we have used above are simple to use and can be used quickly to get the days between dates. But if you want to change the days for the weekend while getting the count between days.

change-the-days-for-weekend
=NETWORKDAYS.INTL(A1,B1,3)

In this function, there is an argument “[weekend]” which allows you to decide days for the weekend.

networkdays.intl-function

Total Number of Days (Only Workdays)

For this, you can use the NETWORKDAYS function. In the first argument refer to the start date and the in the second argument, refer to the end date.

total-number-of-workdays

And the moment you hit enter it returns the count of days which are workdays between the start date (01-Jan-2023) to the end date (01-Feb-2023).

=NETWORKDAYS(A1,B1)

Also Deduct Holidays

And if also want to deduct holidays while calculating days between two dates you can use the NETWORKDAYS and specify a range with the list of holidays dates.

deduct-holidays-from-days-count

And the moment you hit enter it returns total number of days after deducting the holidays. Both these methods which we have discussed above can help you when you want to deduct some specific holidays and weekends.

Using DATEDIF function to Get the Count of Days

DATEDIF is a specific function which can use to calculate difference between two dates. You need to refer to the start date and a unit which you want to get in the result (days, months, years).

dateif-to-get-days-count

In this example, we have used “d” in the unit to get the count of days between the dates you have specified.

=DATEDIF(A1,B1,"d")

Get the Sample Sheet