DATEDIF, DAYS, EDATE and EOMONTH Excel Practice Questions with Solutions

Introduction

Excel date calculations become much more useful when you need to find the difference between dates, calculate future or previous months, or find the beginning and end of a month. In this chapter, you will practice DATEDIF, DAYS, EDATE, and EOMONTH with practical examples. These functions are commonly useful for calculating age, service duration, subscription periods, due dates, monthly reports, and billing dates. DATEDIF, DAYS, EDATE and EOMONTH Excel Practice questions with solutions to help you understand the concepts.


Question 1: Calculate the Number of Days Between Two Dates Using DAYS

Problem Statement

Find the number of days between the order date and delivery date.

Excel Data

Order DateDelivery DateDays Taken
01/09/202605/09/2026
03/09/202610/09/2026
10/09/202618/09/2026
15/09/202620/09/2026
20/09/202628/09/2026

Solution

In C2, enter:

=DAYS(B2,A2)

Copy the formula down.

Expected Output

Order DateDelivery DateDays Taken
01/09/202605/09/20264
03/09/202610/09/20267
10/09/202618/09/20268
15/09/202620/09/20265
20/09/202628/09/20268

DAYS(end_date,start_date) returns the number of days between two dates.


Question 2: Calculate Complete Years Using DATEDIF

Problem Statement

Calculate the completed years of service for each employee.

Excel Data

EmployeeJoining DateAs-of DateCompleted Years
Rahul15/06/201828/09/2026
Priya20/09/202028/09/2026
Amit10/01/201928/09/2026
Neha05/12/202128/09/2026
Arjun25/08/201728/09/2026

Solution

In D2, enter:

=DATEDIF(B2,C2,"Y")

Copy down.

Expected Output

EmployeeJoining DateAs-of DateCompleted Years
Rahul15/06/201828/09/20268
Priya20/09/202028/09/20266
Amit10/01/201928/09/20267
Neha05/12/202128/09/20264
Arjun25/08/201728/09/20269

"Y" tells DATEDIF to return completed years.


Question 3: Calculate Complete Months Using DATEDIF

Problem Statement

Calculate how many complete months have passed between the subscription start date and end date.

Excel Data

CustomerStart DateEnd DateComplete Months
Rahul15/01/202615/09/2026
Priya10/02/202610/08/2026
Amit05/03/202620/09/2026
Neha01/04/202601/10/2026
Arjun12/05/202612/09/2026

Solution

In D2, enter:

=DATEDIF(B2,C2,"M")

Copy down.

Expected Output

CustomerStart DateEnd DateComplete Months
Rahul15/01/202615/09/20268
Priya10/02/202610/08/20266
Amit05/03/202620/09/20266
Neha01/04/202601/10/20266
Arjun12/05/202612/09/20264

"M" returns completed months.


Question 4: Calculate Age Using DATEDIF

Problem Statement

Calculate each person’s completed age as of 28 September 2026.

Excel Data

NameDate of BirthAs-of DateAge
Rahul15/06/200028/09/2026
Priya20/10/200228/09/2026
Amit10/01/199828/09/2026
Neha05/12/200528/09/2026
Arjun25/08/199528/09/2026

Solution

In D2, enter:

=DATEDIF(B2,C2,"Y")

Copy down.

Expected Output

NameDate of BirthAs-of DateAge
Rahul15/06/200028/09/202626
Priya20/10/200228/09/202623
Amit10/01/199828/09/202628
Neha05/12/200528/09/202620
Arjun25/08/199528/09/202631

Question 5: Calculate Years and Remaining Months Using DATEDIF

Problem Statement

Calculate an employee’s completed years and remaining months of service.

For example:

8 years 3 months

Excel Data

EmployeeJoining DateAs-of DateService
Rahul15/06/201828/09/2026
Priya20/02/202028/09/2026
Amit10/01/201928/09/2026
Neha05/12/202128/09/2026
Arjun25/08/201728/09/2026

Solution

In D2, enter:

=DATEDIF(B2,C2,"Y")&" years "&DATEDIF(B2,C2,"YM")&" months"

Copy down.

Expected Output

EmployeeJoining DateAs-of DateService
Rahul15/06/201828/09/20268 years 3 months
Priya20/02/202028/09/20266 years 7 months
Amit10/01/201928/09/20267 years 8 months
Neha05/12/202128/09/20264 years 9 months
Arjun25/08/201728/09/20269 years 1 month

"YM" returns the remaining complete months after completed years are removed.


Question 6: Calculate a Date Six Months Later Using EDATE

Problem Statement

A customer purchases a six-month subscription. Calculate the subscription end date based on the starting date.

Excel Data

CustomerStart DateDate After 6 Months
Rahul15/01/2026
Priya20/02/2026
Amit10/03/2026
Neha05/04/2026
Arjun12/05/2026

Solution

In C2, enter:

=EDATE(B2,6)

Copy down.

Expected Output

CustomerStart DateDate After 6 Months
Rahul15/01/202615/07/2026
Priya20/02/202620/08/2026
Amit10/03/202610/09/2026
Neha05/04/202605/10/2026
Arjun12/05/202612/11/2026

EDATE moves a date forward or backward by a specified number of months.


Question 7: Calculate a Date Three Months Earlier Using EDATE

Problem Statement

An invoice was generated on the dates below. Find the date exactly three months earlier.

Excel Data

Invoice DateDate 3 Months Earlier
15/09/2026
20/10/2026
10/11/2026
25/12/2026
15/01/2027

Solution

In B2, enter:

=EDATE(A2,-3)

Copy down.

Expected Output

Invoice DateDate 3 Months Earlier
15/09/202615/06/2026
20/10/202620/07/2026
10/11/202610/08/2026
25/12/202625/09/2026
15/01/202715/10/2026

A negative number tells EDATE to move backward.


Question 8: Find the End of the Current Month Using EOMONTH

Problem Statement

Find the last date of the month for each given date.

Excel Data

DateMonth End
05/01/2026
15/02/2026
20/04/2026
10/09/2026
25/11/2026

Solution

In B2, enter:

=EOMONTH(A2,0)

Copy down.

Expected Output

DateMonth End
05/01/202631/01/2026
15/02/202628/02/2026
20/04/202630/04/2026
10/09/202630/09/2026
25/11/202630/11/2026

The 0 means the current month.


Question 9: Find the End of the Next Month

Problem Statement

For each invoice date, find the last day of the following month.

Excel Data

Invoice DateEnd of Next Month
15/01/2026
20/02/2026
10/03/2026
05/09/2026
25/11/2026

Solution

In B2, enter:

=EOMONTH(A2,1)

Copy down.

Expected Output

Invoice DateEnd of Next Month
15/01/202628/02/2026
20/02/202631/03/2026
10/03/202630/04/2026
05/09/202631/10/2026
25/11/202631/12/2026

1 tells EOMONTH to move one month forward before finding the month’s final date.


Question 10: Create a Subscription Period Using EDATE and EOMONTH

Problem Statement

A company starts monthly subscriptions on different dates. For each subscription:

  1. Calculate the date six months later.
  2. Find the last day of that ending month.

Excel Data

CustomerStart DateDate After 6 MonthsEnd of Ending Month
Rahul15/01/2026
Priya20/02/2026
Amit10/03/2026
Neha05/04/2026
Arjun12/05/2026

Solution

In C2, enter:

=EDATE(B2,6)

In D2, enter:

=EOMONTH(C2,0)

Copy both formulas down.

Expected Output

CustomerStart DateDate After 6 MonthsEnd of Ending Month
Rahul15/01/202615/07/202631/07/2026
Priya20/02/202620/08/202631/08/2026
Amit10/03/202610/09/202630/09/2026
Neha05/04/202605/10/202631/10/2026
Arjun12/05/202612/11/202630/11/2026

This combines EDATE and EOMONTH to create a practical subscription-date calculation.


Key Takeaways

  • DATEDIF in excel calculates the difference between two dates in years, months, or days.
  • DAYS calculates the number of days between two dates.
  • EDATE moves a date forward or backward by a specified number of months.
  • EOMONTH in excel returns the last date of a month.
  • DATEDIF(...,"Y") returns completed years.
  • DATEDIF(...,"M") returns completed months.
  • DATEDIF(...,"D") returns completed days.
  • DATEDIF(...,"YM") returns remaining complete months after completed years.
  • EDATE(A2,6) moves six months forward.
  • EDATE(A2,-3) moves three months backward.
  • EOMONTH(A2,0) returns the end of the current month.
  • EOMONTH(A2,1) returns the end of the following month.
  • These functions are useful for age calculations, employee service periods, subscriptions, invoices, billing cycles, and monthly reports.

FAQs

1. What does DATEDIF do in Excel?

DATEDIF calculates the difference between two dates using different units such as years, months, and days.

For example:

=DATEDIF(A2,B2,"Y")

returns the number of completed years between the two dates.

2. Is DATEDIF available in Excel?

Yes. DATEDIF is supported in Excel, although it may not appear in Excel’s function autocomplete or function list in the same way as many other functions.

3. What is the difference between DATEDIF and DAYS?

DATEDIF can calculate differences in years, months, or days depending on the unit.

DAYS specifically returns the number of days between two dates.

=DAYS(B2,A2)

4. What does EDATE do?

EDATE moves a date by a specified number of months.

For example:

=EDATE(A2,6)

moves the date six months forward.

5. Can EDATE move a date backward?

Yes. Use a negative number of months.

=EDATE(A2,-3)

moves the date three months backward.

6. What does EOMONTH do?

EOMONTH returns the last date of a specified month.

=EOMONTH(A2,0)

returns the last day of the month containing the date in A2.

7. What is the difference between EDATE and EOMONTH?

EDATE returns the same day of the month after moving by a specified number of months.

EOMONTH returns the last day of the resulting month.

For example:

=EDATE(A2,1)

and

=EOMONTH(A2,1)

can return different dates.

8. How can I calculate someone’s age using DATEDIF?

If the date of birth is in A2 and the reference date is in B2:

=DATEDIF(A2,B2,"Y")

returns the completed age in years.

9. How can I calculate years and months together?

You can combine two DATEDIF calculations:

=DATEDIF(A2,B2,"Y")&" years "&DATEDIF(A2,B2,"YM")&" months"

For example, the result can be 8 years 3 months.

10. Why is EOMONTH useful in Excel reports?

EOMONTH is useful when you need monthly closing dates, billing periods, subscription end dates, monthly reports, or financial period calculations without manually determining whether a month has 28, 29, 30, or 31 days.

Written by Shubhranshu Shekhar, who has trained 20000+ students in coding.

Scroll to Top