Function Problems

Calculate Months Between Dates in Excel Using the First Available Date

Anum MushtaqAnum Mushtaq Nov 18, 2026 871 views

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.

Calculate Months in Excel Using the First Available Date
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.
Before you start

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.

Solution 1Recommended

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.

1
Check the table headers

In the Excel table, confirm that the headers are named LOA Signature Date and Signed. Adjust the formula references if your headers differ.

2
Enter the formula

Select a cell in a new result column and enter =DATEDIF(IF([@[LOA Signature Date]]="",[@Signed],[@[LOA Signature Date]]),TODAY(),"m").

3
Review the result

Press Enter and check the calculated column. The formula counts complete months from the selected date to today.

Use DATEDIF with structured references in an Excel table
Check blank and future dates: Make sure at least one date is present. If the selected date is later than today, DATEDIF returns a #NUM! error.
Calculate dates in WPS Spreadsheets

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. 1. Open the workbook: Open WPS Spreadsheets and select Open to load your Excel workbook.
  2. 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. 3. Enter the formula: Select a result cell and enter =DATEDIF(IF(B2="",C2,B2),TODAY(),"m"), changing the cell references if necessary.
  4. 4. Copy the calculation: Press Enter and drag the result cell's fill handle down to apply the formula to other rows.
Count complete months using the first available dateOpen and edit Microsoft Excel XLSX and XLS filesFill the same formula down multiple rowsWork with a familiar spreadsheet interface
microsoft office alternative - wps office

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.