Calculate Months Between Dates in Excel Using the First Available Date
Question details
Calculate completed months between today and the LOA Signature Date, falling back to the Signed Date when the LOA Signature Date is blank.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet has two possible start dates, and the user wants to calculate elapsed months from the preferred date or its fallback.
- Observed behavior
- The desired result uses the LOA Signature Date when available and otherwise uses the Signed Date.
Check that the date cells contain valid Excel dates rather than text. Confirm the column names or cell references and ensure the selected start date is not in the future.
Use DATEDIF with structured references in an Excel table
Use this formula when the dates are stored in an Excel table with LOA Signature Date and Signed columns.
In the Excel table, confirm that the headers are named LOA Signature Date and Signed. Adjust the formula references if your headers differ.
Select a cell in a new result column and enter =DATEDIF(IF([@[LOA Signature Date]]="",[@Signed],[@[LOA Signature Date]]),TODAY(),"m").
Press Enter and check the calculated column. The formula counts complete months from the selected date to today.

Use cell references in a regular Excel range
Use this version when the dates are in ordinary cells rather than an Excel table.
Calculate elapsed months in WPS Spreadsheets
Use IF, DATEDIF, and TODAY in WPS Spreadsheets to count complete months from the LOA Signature Date or fall back to the Signed Date.
- 1. Open the workbook: Open WPS Spreadsheets and select Open to load your Excel workbook.
- 2. Check the date columns: Locate the LOA Signature Date and Signed Date cells. For example, use B2 for the LOA date and C2 for the Signed Date.
- 3. Enter the formula: Select a result cell and enter =DATEDIF(IF(B2="",C2,B2),TODAY(),"m"), changing the cell references if necessary.
- 4. Copy the calculation: Press Enter and drag the result cell's fill handle down to apply the formula to other rows.

Frequently Asked Questions
Does the formula count partial months?
No. The "m" argument in DATEDIF counts complete months between the selected start date and today.
What happens if both date cells are blank?
The basic formula may treat a blank date as a date serial value and produce an unintended result. Enter at least one valid date before using it.
Why does the formula show #NUM!?
DATEDIF returns #NUM! when the selected start date is later than TODAY(). Check the LOA Signature Date or, if it is blank, the Signed Date.
Will the result change tomorrow?
TODAY() supplies the current date when the workbook recalculates. The completed-month result changes when another full month has elapsed.




