How to Use Excel DATEDIF to Calculate Months Between Dates
Question details
The user wants to calculate the number of complete months between two dates using Excel's DATEDIF function.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user wants to enter DATEDIF to calculate elapsed months but cannot find it in the function list.
- Observed behavior
- DATEDIF may not appear in Excel's function list or Formula AutoComplete, but it can still work when typed directly into a cell.
Enter valid Excel dates in cells A1 and B1, with the earlier date in A1. DATEDIF returns an error if the start date is later than the end date.
Enter DATEDIF Manually to Count Complete Months
Use this method when DATEDIF is missing from the function list or Formula AutoComplete.
DATEDIF is retained for compatibility with older Lotus 1-2-3 files, so Excel may not suggest it as you type. The "m" unit counts complete months, not partial months.
In the worksheet, enter the earlier date in A1 and the later date in B1.
Select an empty cell and type =DATEDIF(A1,B1,"m"). If your regional settings use semicolons as argument separators, enter =DATEDIF(A1;B1;"m") instead.
Press Enter. The cell displays the number of complete months between the dates.

Calculate Complete Months with DATEDIF in WPS Spreadsheets
Use DATEDIF in WPS Spreadsheets to calculate complete months between two dates in a worksheet.
- 1. Open a worksheet: Open WPS Spreadsheets and create a workbook or open an existing Excel file.
- 2. Enter the dates: Enter the earlier date in A1 and the later date in B1.
- 3. Enter DATEDIF: Select an empty cell, type =DATEDIF(A1,B1,"m"), and press Enter to display the number of complete months.
- 4. Save the workbook: Choose File > Save As and select XLSX if you want to keep the workbook in an Excel-compatible format.

Frequently Asked Questions
Why can't I find DATEDIF in Excel's function list?
DATEDIF is a compatibility function and may not appear in the function list or Formula AutoComplete. Type it directly into a cell, such as =DATEDIF(A1,B1,"m").
Does DATEDIF count partial months?
No. The "m" unit returns only complete months between the start and end dates.
How can I calculate years or days instead of months?
Replace "m" with "y" for complete years or "d" for total days. For example, use =DATEDIF(A1,B1,"d") to count days.
Why does my DATEDIF formula return an error?
A start date later than the end date returns #NUM!. Unrecognized text instead of a valid date can return #VALUE!. Check the dates in A1 and B1 and confirm the start date is earlier.
Can I use DATEDIF in Excel for Mac?
Yes. Type the formula directly into a worksheet cell, even if DATEDIF does not appear in the function list or Formula AutoComplete.




