There are a couple of useful functions in Google Sheets that will quickly calculate the number of days between the two specified dates.
This kind of calculation can be useful if you’re creating a schedule for your students or while creating project plans that have the start and end dates.
In this tutorial, I will show you how to calculate the number of days, number of weekdays, and number of weekends between two dates in Google Sheets.
This Tutorial Covers
Suppose you have the two dates as shown below:
The easiest way to calculate the number of days between the two specified dates is to subtract the start date from the end date.
Below formula would work in this case:
Another way to calculate the same is to use the DAYS function.
Below formula would also give the same result:
Note that the result here would not include both the start and end date in the calculation.For example, if the start date is January 1, 2018, and end date is January 2, 2018, the result would be 1.
For example, if the start date is January 1, 2018, and end date is January 2, 2018, the result would be 1.
If you want both the start and end date included in the result, you need to add 1 back to the result.
If you’re creating a project plan, it’s likely that you are interested in the working days only.
Now to calculate the working days, you need to exclude all the weekend days and all the holidays occurring on weekdays.
Here are the two functions we will use to calculate the number of working days:
Let’s first have a look at the syntax of NETWORKDAYS in Google Sheets.
NETWORKDAYS Function – Syntax & Arguments
=NETWORKDAYS(start_date, end_date, [holidays])
Now let’s see an example where we calculate the number working days between two dates.
Suppose you have a data set as shown below and you want to calculate the number of working days for each activity (the result should exclude holidays and Saturdays/Sundays).
Below is the formula that will give you the total number of working days:
In most cases, the weekend days are Saturday and Sunday.
However, it may not always be the case. For example, in some countries, the weekend days are Friday and Saturday, and in some jobs, you may have a working Saturday and only Sunday is the weekend holiday.
In such cases, you need to use the NETWORKDAYS.INTL function.
Let’s first have a look at the syntax of the NETWORKDAYS.INTL function in Google Sheets.
NETWORKDAYS.INTL Function – Syntax & Arguments
NETWORKDAYS.INTL stands for Networkdays International function.
=NETWORKDAYS.INTL(start_date, end_date, [weekend], [holidays])
Now let’s see an example where we need to calculate the number of working days between two dates and the weekend days are Friday and Saturday.
Below is the formula that will give us the number of working days for each activity:
Note that the third argument of the formula is 7, which is the number that represents Friday and Saturday and weekend days.
If you want to use the string method of specifying weekends, you can use the below formula and it will give the same result:
Remember the 0 in the string represents a working day and 1 represents a non-working day. “0000110” means that Friday and Saturday are non-working days.
To calculate the number of weekends days between two dates, we can use the NETWORKDAYS function along with the DAYS function.
Suppose you have the data set as shown below:
Here is the formula that will give you the total number of weekend days between two specified dates in Google Sheets:
Note that here we have assumed that the weekend days are Saturday and Sunday. In case you want to calculate it for days other than Saturday and Sunday, use the NETWORKDAYS.INTL function.
Sometimes, when scheduling classes for student or creating project plans, you may want to know exactly how many Mondays, or Tuesdays, or any other specific days are there between two dates.
You can use the NETWORKDAYS.INTL function to get the number of any specific day(s) in Google Sheets. The trick here is to specify only Monday as the working day and all the remaining days as the non-working days.
Here is the formula that will give the number of Mondays between two dates:
Note that the string used in the formula is “0111111”. This string means that Monday is a working day and all other days are non-working days.
Hence this formula only returns the number of Mondays.
You can use the same concept to find the number of any other weekday or combinations of weekdays. A situation where this could be useful is when you want to calculate the number of working days in a part-time job (where let’s say you work only on Mondays and Wednesdays).
You May Also Like the Following Google Sheets Tutorials: