How to Calculate Number of Days Between Two Dates in Excel

Open MS Excel., Add the start date and end date., Choose the output cell., Know the formula and write it., Append the necessary strings and make a multifunction formula.

5 Steps 2 min read Medium

Step-by-Step Guide

  1. Step 1: Open MS Excel.

    Remember to format it by DATE (or else the formula won't be working.) , Here we will be writing a pretty simple formula to calculate the difference. , Switch to the formula bar.

    Here, write =DATEDIF(A1,B1,"d") (A1 being the cell with start date and A2 with end date.) It will output the number of days between the two dates.

    The syntax is: =DATEDIF(start_date,end_date,mode) The various modes that can be used are "m"

    "y"

    "d"

    "ym"

    "yd"

    "md" "m" refers to only months. "y" refers to only years. "d" refers to only dates. "ym" filters off the unique years and returns the month difference between the months considering both years to be same. "yd" filters off the unique years and returns the month difference between the days considering both years to be same. "md" filters off the unique months and returns the difference between the days considering both months to be same. , So, now a common thing that many excel pages may need is the number of years, months and dates between two specific dates can be easily found by applying the formula: =DATEDIF(A1,B1,"y") & " years, " & DATEDIF(A1,B1,"ym") & " months, " & DATEDIF(A1,B1,"md") & " days"
  2. Step 2: Add the start date and end date.

  3. Step 3: Choose the output cell.

  4. Step 4: Know the formula and write it.

  5. Step 5: Append the necessary strings and make a multifunction formula.

Detailed Guide

Remember to format it by DATE (or else the formula won't be working.) , Here we will be writing a pretty simple formula to calculate the difference. , Switch to the formula bar.

Here, write =DATEDIF(A1,B1,"d") (A1 being the cell with start date and A2 with end date.) It will output the number of days between the two dates.

The syntax is: =DATEDIF(start_date,end_date,mode) The various modes that can be used are "m"

"y"

"d"

"ym"

"yd"

"md" "m" refers to only months. "y" refers to only years. "d" refers to only dates. "ym" filters off the unique years and returns the month difference between the months considering both years to be same. "yd" filters off the unique years and returns the month difference between the days considering both years to be same. "md" filters off the unique months and returns the difference between the days considering both months to be same. , So, now a common thing that many excel pages may need is the number of years, months and dates between two specific dates can be easily found by applying the formula: =DATEDIF(A1,B1,"y") & " years, " & DATEDIF(A1,B1,"ym") & " months, " & DATEDIF(A1,B1,"md") & " days"

About the Author

R

Roy King

A seasoned expert in education and learning, Roy King combines 5 years of experience with a passion for teaching. Roy's guides are known for their clarity and practical value.

45 articles
View all articles

Rate This Guide

--
Loading...
5
0
4
0
3
0
2
0
1
0

How helpful was this guide? Click to rate: