How many months are between two dates Excel?

Use the DATEDIF function when you want to calculate the difference between two dates. First put a start date in a cell, and an end date in another. Then type a formula like one of the following.

Warning: I f the Start_date is greater than the End_date, the result will be #NUM!.

Difference in days

How many months are between two dates Excel?

In this example, the start date is in cell D9, and the end date is in E9. The formula is in F9. The “d” returns the number of full days between the two dates.

Difference in weeks

How many months are between two dates Excel?

In this example, the start date is in cell D13, and the end date is in E13. The “d” returns the number of days. But notice the /7 at the end. That divides the number of days by 7, since there are 7 days in a week. Note that this result also needs to be formatted as a number. Press CTRL + 1. Then click Number > Decimal places: 2.

Difference in months

How many months are between two dates Excel?

In this example, the start date is in cell D5, and the end date is in E5. In the formula, the “m” returns the number of full months between the two days.

Difference in years

How many months are between two dates Excel?

In this example, the start date is in cell D2, and the end date is in E2. The “y” returns the number of full years between the two days.

Calculate age in accumulated years, months, and days

You can also calculate age or someone’s time of service. The result can be something like “2 years, 4 months, 5 days.”

1. Use DATEDIF to find the total years.

How many months are between two dates Excel?

In this example, the start date is in cell D17, and the end date is in E17. In the formula, the “y” returns the number of full years between the two days.

2. Use DATEDIF again with “ym” to find months.

How many months are between two dates Excel?

In another cell, use the DATEDIF formula with the “ym” parameter. The “ym” returns the number of remaining months past the last full year.

3. Use a different formula to find days.

How many months are between two dates Excel?

Now we need to find the number of remaining days. We'll do this by writing a different kind of formula, shown above. This formula subtracts the first day of the ending month (5/1/2016) from the original end date in cell E17 (5/6/2016). Here's how it does this: First the DATE function creates the date, 5/1/2016. It creates it using the year in cell E17, and the month in cell E17. Then the 1 represents the first day of that month. The result for the DATE function is 5/1/2016. Then, we subtract that from the original end date in cell E17, which is 5/6/2016. 5/6/2016 minus 5/1/2016 is 5 days.

Warning: We don't recommend using the DATEDIF "md" argument because it may calculate inaccurate results.

4. Optional: Combine three formulas in one.

How many months are between two dates Excel?

You can put all three calculations in one cell like this example. Use ampersands, quotes, and text. It’s a longer formula to type, but at least it’s all in one. Tip: Press ALT+ENTER to put line breaks in your formula. This makes it easier to read. Also, press CTRL+SHIFT+U if you can’t see the whole formula.

Download our examples

Other date and time calculations

As you saw above, the DATEDIF function calculates the difference between a start date and an end date. However, instead of typing specific dates, you can also use the TODAY() function inside the formula. When you use the TODAY() function, Excel uses your computer's current date for the date. Keep in mind this will change when the file is opened again on a future day.

How many months are between two dates Excel?

Please note that at the time of this writing, the day was October 6, 2016.

Use the NETWORKDAYS.INTL function when you want to calculate the number of workdays between two dates. You can also have it exclude weekends and holidays too.

Before you begin: Decide if you want to exclude holiday dates. If you do, type a list of holiday dates in a separate area or sheet. Put each holiday date in its own cell. Then select those cells, select Formulas > Define Name. Name the range MyHolidays, and click OK. Then create the formula using the steps below.

1. Type a start date and an end date.

How many months are between two dates Excel?

In this example, the start date is in cell D53 and the end date is in cell E53.

2. In another cell, type a formula like this:

How many months are between two dates Excel?

Type a formula like the above example. The 1 in the formula establishes Saturdays and Sundays as weekend days, and excludes them from the total.

Note: Excel 2007 doesn't have the NETWORKDAYS.INTL function. However, it does have NETWORKDAYS. The above example would be like this in Excel 2007: =NETWORKDAYS(D53,E53). You don't specify the 1 because NETWORKDAYS assumes the weekend is on Saturday and Sunday.

3. If necessary, change the 1.

How many months are between two dates Excel?

If Saturday and Sunday are not your weekend days, then change the 1 to another number from the IntelliSense list. For example, 2 establishes Sundays and Mondays as weekend days.

If you are using Excel 2007, skip this step. Excel 2007's NETWORKDAYS function always assumes the weekend is on Saturday and Sunday.

4. Type the holiday range name.

How many months are between two dates Excel?

If you created a holiday range name in the “Before you begin” section above, then type it at the end like this. If you don't have holidays, you can leave the comma and MyHolidays out. If you are using Excel 2007, the above example would be this instead: =NETWORKDAYS(D53,E53,MyHolidays).

Tip: If you don’t want to reference a holiday range name, you can also type a range instead, like D35:E:39. Or, you could type each holiday inside the formula. For example if your holidays were on January 1 and 2 of 2016, you'd type them like this: =NETWORKDAYS.INTL(D53,E53,1,{"1/1/2016","1/2/2016"}). In Excel 2007, it would look like this: =NETWORKDAYS(D53,E53,{"1/1/2016","1/2/2016"})

You can calculate elapsed time by subtracting one time from another. First put a start time in a cell, and an end time in another. Make sure to type a full time, including the hour, minutes, and a space before the AM or PM. Here’s how:

1. Type a start time and end time.

How many months are between two dates Excel?

In this example, the start time is in cell D80 and the end time is in E80. Make sure to type the hour, minute, and a space before the AM or PM.

2. Set the h:mm AM/PM format.

How many months are between two dates Excel?

Select both dates and press CTRL + 1 (or

How many months are between two dates Excel?
+ 1 on the Mac). Make sure to select Custom > h:mm AM/PM, if it isn’t already set.

3. Subtract the two times.

How many months are between two dates Excel?

In another cell, subtract the start time cell from the end time cell.

4. Set the h:mm format.

How many months are between two dates Excel?

Press CTRL + 1 (or

How many months are between two dates Excel?
+ 1 on the Mac). Choose Custom > h:mm so that the result excludes AM and PM.

To calculate the time between two dates and times, you can simply subtract one from the other. However, you must apply formatting to each cell to ensure that Excel returns the result you want.

1. Type two full dates and times.

How many months are between two dates Excel?

In one cell, type a full start date/time. And in another cell, type a full end date/time. Each cell should have a month, day, year, hour, minute, and a space before the AM or PM.

2. Set the 3/14/12 1:30 PM format.

How many months are between two dates Excel?

Select both cells, and then press CTRL + 1 (or

How many months are between two dates Excel?
+ 1 on the Mac). Then select Date > 3/14/12 1:30 PM. This isn't the date you'll set, it's just a sample of how the format will look. Note that in versions prior to Excel 2016, this format might have a different sample date like 3/14/01 1:30 PM.

3. Subtract the two.

How many months are between two dates Excel?

In another cell, subtract the start date/time from the end date/time. The result will probably look like a number and decimal. You'll fix that in the next step.

4. Set the [h]:mm format.

How many months are between two dates Excel?

Press CTRL + 1 (or

How many months are between two dates Excel?
+ 1 on the Mac). Select Custom. In the Type box, type [h]:mm.

DATEDIF function
NETWORKDAYS.INTL function
NETWORKDAYS
More date and time functions
Calculate the difference between two times

How do you calculate months between 2 dates in Excel?

Use the DATEDIF function when you want to calculate the difference between two dates. First put a start date in a cell, and an end date in another..
Use DATEDIF to find the total years. ... .
Use DATEDIF again with “ym” to find months. ... .
Use a different formula to find days..

How do I calculate years and months of service between two dates in Excel?

How to Calculate Years of Service in Excel Using DATEDIF.
Click the cell where you want the years of service to appear..
Type: =DATEDIF(.
Click the cell containing the start date, then type a comma..
Click the cell containing the end date, type a comma, then type: “y”).
Press Enter and the years of service will calculate..

How do I use Datedif for months?

Now, these differences can be in years, months, or days. It takes two dates as an argument and one keyword to specify which type of difference is desired for the output. The output for this function is an integer, and the method to use this function is as follows =DATEDIF(start_date, end_date, unit).

How do I calculate how long between two dates?

But it's straightforward to calculate the number of whole years between two dates:.
Take the year number of the current date. That's 2022, in this example..
Then take the year number of the date in the past. 2013, in this case..
Subtract 2013 away from 2022..
The result is 9 years..