Calculate the Number of Days between 2 dates in Excel

Last Updated on 15/11/2023
Reading time: 2 minutes

Calculating the number of days between 2 dates can be simple or complex in Excel. It depends on whether you want to include all days or only weekdays (excluding weekends).

  1. Including all days

    This is the easiest way to calculate the number of days between 2 dates

  2. Exclude the weekends and also holidays

    This time, you must use the NETWORKDAYS function

Count all the days (weekdays and weekends)

When you want to count the number of days between 2 dates, many people do this

=B2-B1

But this formula is wrong because you exclude the first day 😱😱

Wrong formula to calculate the number of days between 2 dates

That's why you must add 1 to take into account the first of your range of dates 👍

=B2-B1+1

Correct formula to calculate the number of days between 2 dates

If you want to know how to build the same weekly calendar in the columns D:J, refer to this article

Number of working days between two dates

Now, if you want to count the number of days between two dates, without weekends, you must use the you must use the NETWORDAYS function.

  • The first argument is the begining date
  • The second argument is the ending date

=NETWORKDAYS(B1,B2)

NETWORDAYS function to count the number of working days between 2 dates

Excluding holidays

To exclude holidays, select the range containing the dates as the third argument of the NETWORKDAYS function

=NETWORKDAYS(B1,B2,A8:A11)

Exclude also the holidays by addind them in the NETWORKDAYS function

You can also use the public holidays as third argument of the function.

Related articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Calculate the Number of Days between 2 dates in Excel

Reading time: 2 minutes
Last Updated on 15/11/2023

Calculating the number of days between 2 dates can be simple or complex in Excel. It depends on whether you want to include all days or only weekdays (excluding weekends).

  1. Including all days

    This is the easiest way to calculate the number of days between 2 dates

  2. Exclude the weekends and also holidays

    This time, you must use the NETWORKDAYS function

Count all the days (weekdays and weekends)

When you want to count the number of days between 2 dates, many people do this

=B2-B1

But this formula is wrong because you exclude the first day 😱😱

Wrong formula to calculate the number of days between 2 dates

That's why you must add 1 to take into account the first of your range of dates 👍

=B2-B1+1

Correct formula to calculate the number of days between 2 dates

If you want to know how to build the same weekly calendar in the columns D:J, refer to this article

Number of working days between two dates

Now, if you want to count the number of days between two dates, without weekends, you must use the you must use the NETWORDAYS function.

  • The first argument is the begining date
  • The second argument is the ending date

=NETWORKDAYS(B1,B2)

NETWORDAYS function to count the number of working days between 2 dates

Excluding holidays

To exclude holidays, select the range containing the dates as the third argument of the NETWORKDAYS function

=NETWORKDAYS(B1,B2,A8:A11)

Exclude also the holidays by addind them in the NETWORKDAYS function

You can also use the public holidays as third argument of the function.

Related articles

Leave a Reply

Your email address will not be published. Required fields are marked *