Excel Tutorial
Excel tutorials, quizzes & AI guides — all levels
RSS
  • Online Excel Exercises
  • Training
  • Excel Tests
  • Sitemap
  • Premium Quizzes
  • Shop
  • My account

How to Calculate the Number of Days Between Two Dates in Excel

Date
Reading time: 2 minutes
Views: 4,122

How many days between two dates? In Excel, the answer is a simple subtraction, but you need to know which days you are counting. The time it took a customer to pay an invoice and the number of days in a holiday period are two different questions, and they don’t give the same result.

Try it right now

Ten invoices, an issue date and a payment date: how long did each customer take to pay? Work it out in 6 steps, free and corrected as you type:

Date Exercise - Calculate an invoice's payment time (in days and weeks)

Calculate the number of days between two invoice dates by subtraction, add days to a date, and count full weeks with INT — 6 guided steps.

Compute the difference between D2 and C2 in G2

1 / 6

Compute the payment period of INV-001 (D2 − C2)

Dates — Q1 · 605

=D2-C2

Compute the difference between D5 and C5 in G2

2 / 6

Compute the payment period of INV-004 (D5 − C5)

Dates — Q2 · 606

=D5-C5

Compute the difference between D10 and C10 in G2

3 / 6

Compute the payment period of INV-009 (D10 − C10)

Dates — Q3 · 607

=D10-C10

Compute the difference between C6 and C2 in G2

4 / 6

Number of days between the issue of INV-001 and INV-005 (C6 − C2)

Dates — Q4 · 608

=C6-C2

Add 7 days to C2 in G2

5 / 6

Add 7 days to the issue date of INV-001 (C2)

Dates — Q5 · 609

=C2+7

Divide the difference D4−C2 by 7 and round down with INT — G2

6 / 6

Number of full weeks between C2 and D4 (use INT)

Dates — Q6 · 610

=INT((D4-C2)/7)

Your score is

0%

Subtract the two dates

Excel stores every date as a number: 1 for 1 January 1900, then one more for each day. So the difference between two dates is just one date minus the other.

=B2-B1

Between 23 October and 15 November 2023, the result is 23. That is the number of days that have passed: a payment time, a delivery delay, the nights spent in a hotel. This is what the exercise above uses.

💡 If the result shows as a date instead of a number, change the cell format to General.

Wrong formula to calculate the number of days between 2 dates

Add 1 when both days count

Now count the days on a calendar from 23 October to 15 November: there are 24, not 23. The subtraction leaves out the first day. When both the first and the last day are part of the period (days of holiday, days worked on a project, days of a training course), add 1:

=B2-B1+1

Correct formula to calculate the number of days between 2 dates

To count full weeks, divide by 7 and keep the whole part with INT: =INT((B2-B1)/7) returns 3.

Count only the working days

To leave out Saturdays and Sundays, use NETWORKDAYS. The first argument is the start date, the second the end date:

=NETWORKDAYS(B1,B2)

The result is 18. NETWORKDAYS already counts the first and the last day, so there is no need to add 1.

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

Remove the public holidays too

Type the holidays in a range of cells, then select that range as the third argument:

=NETWORKDAYS(B1,B2,A8:A11)

With 4 holidays falling on weekdays, the result drops to 14. A holiday that falls on a weekend changes nothing, because that day was already excluded.

Exclude also the holidays by addind them in the NETWORKDAYS function

If your weekend is not Saturday and Sunday, use NETWORKDAYS.INTL. Its third argument sets the weekend: for example, 7 for Friday and Saturday.

=NETWORKDAYS.INTL(B1,B2,7)

Related Articles

  • The DATEDIF function in Excel
  • Calculate Seniority in Excel
  • Identifying Weekdays and Weekends with Excel
  • Unlocking the Secrets of Excel’s DATE Function

Frédéric LE GUEN

date formula, dates, Difference between 2 dates

Leave a Reply Cancel reply

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

Most Viewed Posts

  • Displaying Negative Numbers in Parentheses in Excel (310,065)
  • Top 10 Excel Functions You Must Know (232,001)
  • How to make automatic calendar in Excel (212,775)
  • Dash for a zero in Excel automatically (190,812)
  • Converting a Date from YYYYMMDD to DD/MM/YYYY in Excel (171,033)
image excel exercises
Excel Exercises
image excel quizzes
Excel Quizzes

How to Calculate the Number of Days Between Two Dates in Excel

Reading time: 2 minutes
Views: 4,122

How many days between two dates? In Excel, the answer is a simple subtraction, but you need to know which days you are counting. The time it took a customer to pay an invoice and the number of days in a holiday period are two different questions, and they don’t give the same result.

Try it right now

Ten invoices, an issue date and a payment date: how long did each customer take to pay? Work it out in 6 steps, free and corrected as you type:

Date Exercise - Calculate an invoice's payment time (in days and weeks)

Calculate the number of days between two invoice dates by subtraction, add days to a date, and count full weeks with INT — 6 guided steps.

Compute the difference between D2 and C2 in G2

1 / 6

Compute the payment period of INV-001 (D2 − C2)

Dates — Q1 · 605

=D2-C2

Compute the difference between D5 and C5 in G2

2 / 6

Compute the payment period of INV-004 (D5 − C5)

Dates — Q2 · 606

=D5-C5

Compute the difference between D10 and C10 in G2

3 / 6

Compute the payment period of INV-009 (D10 − C10)

Dates — Q3 · 607

=D10-C10

Compute the difference between C6 and C2 in G2

4 / 6

Number of days between the issue of INV-001 and INV-005 (C6 − C2)

Dates — Q4 · 608

=C6-C2

Add 7 days to C2 in G2

5 / 6

Add 7 days to the issue date of INV-001 (C2)

Dates — Q5 · 609

=C2+7

Divide the difference D4−C2 by 7 and round down with INT — G2

6 / 6

Number of full weeks between C2 and D4 (use INT)

Dates — Q6 · 610

=INT((D4-C2)/7)

Your score is

0%

Subtract the two dates

Excel stores every date as a number: 1 for 1 January 1900, then one more for each day. So the difference between two dates is just one date minus the other.

=B2-B1

Between 23 October and 15 November 2023, the result is 23. That is the number of days that have passed: a payment time, a delivery delay, the nights spent in a hotel. This is what the exercise above uses.

💡 If the result shows as a date instead of a number, change the cell format to General.

Wrong formula to calculate the number of days between 2 dates

Add 1 when both days count

Now count the days on a calendar from 23 October to 15 November: there are 24, not 23. The subtraction leaves out the first day. When both the first and the last day are part of the period (days of holiday, days worked on a project, days of a training course), add 1:

=B2-B1+1

Correct formula to calculate the number of days between 2 dates

To count full weeks, divide by 7 and keep the whole part with INT: =INT((B2-B1)/7) returns 3.

Count only the working days

To leave out Saturdays and Sundays, use NETWORKDAYS. The first argument is the start date, the second the end date:

=NETWORKDAYS(B1,B2)

The result is 18. NETWORKDAYS already counts the first and the last day, so there is no need to add 1.

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

Remove the public holidays too

Type the holidays in a range of cells, then select that range as the third argument:

=NETWORKDAYS(B1,B2,A8:A11)

With 4 holidays falling on weekdays, the result drops to 14. A holiday that falls on a weekend changes nothing, because that day was already excluded.

Exclude also the holidays by addind them in the NETWORKDAYS function

If your weekend is not Saturday and Sunday, use NETWORKDAYS.INTL. Its third argument sets the weekend: for example, 7 for Friday and Saturday.

=NETWORKDAYS.INTL(B1,B2,7)

Related Articles

  • The DATEDIF function in Excel
  • Calculate Seniority in Excel
  • Identifying Weekdays and Weekends with Excel
  • Unlocking the Secrets of Excel’s DATE Function
Tags: date formuladatesDifference between 2 dates

Frédéric LE GUEN

Leave a Reply Cancel reply

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

Contact us
About me 
Privacy Policy

© 2022 – 2026 – excel-tutorial.com. All Rights Reserved.
Excel Tutorial is managed by majordome du net

Contact us
About me 
Privacy Policy

© 2022 – 2026 – excel-tutorial.com. All Rights Reserved.
Excel Tutorial is managed by majordome du net