TGViewer
MS Excel for Data Analysis MS Excel for Data Analysis @excel_analyst ยท 73.1K subscribers
Post #2270 2.99K
๐Ÿ“Š Excel Basics #30 โ€“ DATEDIF() & EDATE() Functions

When working with employee records, project timelines, subscriptions, loans, or customer data, you often need to calculate the time between dates or move a date forward or backward by a specific number of months.

Two useful functions are DATEDIF() and EDATE().

๐Ÿ“Œ 1. DATEDIF() Function

DATEDIF() calculates the difference between two dates.

Syntax:

=DATEDIF(start_date,end_date,unit)

The unit determines what you want to calculate.

Common units:

โ€ข Y โ†’ Complete years

โ€ข M โ†’ Complete months

โ€ข D โ†’ Total days

โ€ข YM โ†’ Remaining months after complete years

โ€ข YD โ†’ Remaining days after complete years

โ€ข MD โ†’ Remaining days after complete months

๐Ÿ“Œ Example 1 โ€“ Calculate Complete Years

Suppose:

A2 = 01-Jan-2020

B2 = 19-Aug-2026

Formula:

=DATEDIF(A2,B2,"Y")

Result:

6

The employee has completed 6 full years.

๐Ÿ“Œ Example 2 โ€“ Calculate Complete Months

=DATEDIF(A2,B2,"M")

This returns the total number of complete months between the two dates.

๐Ÿ“Œ Example 3 โ€“ Calculate Total Days

=DATEDIF(A2,B2,"D")

This returns the total number of complete days between the dates.

๐Ÿ“Œ Example 4 โ€“ Display Years and Months

You can combine multiple DATEDIF() functions:

=DATEDIF(A2,B2,"Y")&" Years "&DATEDIF(A2,B2,"YM")&" Months"

Example result:

6 Years 7 Months

This is useful for calculating employee tenure or customer relationship duration.

๐Ÿ“Œ 2. EDATE() Function

EDATE() returns a date that is a specified number of months before or after a starting date.

Syntax:

=EDATE(start_date,months)

๐Ÿ“Œ Example 1 โ€“ Add Months

If:

A2 = 19-Aug-2026

Formula:

=EDATE(A2,3)

Result:

19-Nov-2026

๐Ÿ“Œ Example 2 โ€“ Subtract Months

=EDATE(A2,-3)

This returns the date 3 months before the date in A2.

Result:

19-May-2026

๐Ÿ“Œ Real-World Example

Suppose a subscription starts on:

19-Aug-2026

and lasts for 12 months.

Formula:

=EDATE(A2,12)

Result:

19-Aug-2027

You can use this to calculate renewal dates.

๐Ÿ“Œ DATEDIF() vs EDATE()

DATEDIF() โ†’ Calculates the difference between dates.

EDATE() โ†’ Calculates a new date by adding/subtracting months.

Think:

๐Ÿ‘‰ DATEDIF() โ†’ How long?

๐Ÿ‘‰ EDATE() โ†’ What date after/before X months?

๐Ÿ“Œ Real-World Uses

โ€ข Calculate employee experience.

โ€ข Calculate customer tenure.

โ€ข Calculate project duration.

โ€ข Find subscription renewal dates.

โ€ข Calculate loan or contract dates.

โ€ข Track service anniversaries.

๐Ÿ“Œ Common Mistakes

โŒ Putting the end date before the start date in DATEDIF().

โŒ Using the wrong DATEDIF() unit.

โŒ Forgetting that DATEDIF() returns complete units, not rounded values.

โŒ Formatting an EDATE() result as a number instead of a date.

โœ… Quick Tip

Remember:

DATEDIF() โ†’ Difference between two dates

EDATE() โ†’ Move a date by months

These functions are extremely useful when working with real-world business data.

Double Tap โค๏ธ For More
  • โค 13
  • ๐Ÿ‘ 2
More from @excel_analyst
  1. Oct 9, 2026๐Ÿ‡ฎ๐Ÿ‡ณ ๐—š๐—ข๐—ฉ๐—˜๐—ฅ๐—ก๐— ๐—˜๐—ก๐—ง ๐—ข๐—™ ๐—œ๐—ก๐——๐—œ๐—” โ€” ๐—”๐—œ๐—–๐—ง๐—˜ ๐—œ๐—ก๐—ง๐—˜๐—ฅ๐—ก๐—ฆ๐—›๐—œ๐—ฃ๐—ฆ ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ ๐Ÿš€โ€ฆ
  2. Oct 8, 2026๐ŸŽ“ ๐— ๐—ถ๐—ฐ๐—ฟ๐—ผ๐˜€๐—ผ๐—ณ๐˜ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐˜„๐—ถ๐˜๐—ต ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ฒ๐˜€! ๐Ÿš€๐Ÿ”ฅ Upgrโ€ฆ
  3. Oct 7, 2026๐Ÿ“Š Excel Shortcuts โ€” Part 5 This part focuses on Tables, Filters & Data Analysis shortcutsโ€ฆ
  4. Oct 7, 2026๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐโ€ฆ
  5. Oct 7, 2026๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—•๐—œ ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜! ๐Ÿ”ฅ Learn Power BI through these FREE learninโ€ฆ
  6. Sep 29, 2026๐Ÿ“Š Excel Shortcuts โ€” Part 3 This part focuses on Formatting Shortcuts โ€” quickly format celโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’