Function Problems

Calculate Half-Month Differences Between Dates in Excel

Algirdas JasaitisAlgirdas Jasaitis Nov 14, 2026 870 views

Question details

Calculate the number of months between two dates, including a half month when the start date is May 16 and the end date is December 31.

Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet needs to express a date interval in months, including half-month increments.
Observed behavior
The desired result for May 16, 2019, through December 31, 2019, is 7.5 months.
Before you start

Enter the start date in A1 and the end date in B1 as Excel dates, with the start date no later than the end date. Format the result cell as General or Number rather than Date.

Solution 1Recommended

Calculate and round fractional months with YEARFRAC

Use this method to calculate an approximate month difference and optionally round it to the nearest half month.

YEARFRAC with a basis of 0 uses the US 30/360 day-count convention. Multiplying the result by 12 converts the fraction of a year to months.

1
Enter the dates

Type 5/16/2019 in cell A1 and 12/31/2019 in cell B1.

2
Calculate fractional months

Select an empty cell, enter =YEARFRAC(A1,B1,0)*12, and press Enter. The example returns 7.5.

3
Round to a half month

To round other results to the nearest 0.5 month, enter =MROUND(YEARFRAC(A1,B1,0)*12,0.5) in the result cell.

Calculate and round fractional months with YEARFRAC
Check your counting rule: Rounding a 30/360 calculation does not guarantee that every date on the 16th is treated as exactly half a month. If your policy uses fixed calendar cutoffs, verify the formula against those rules.
Calculate dates in WPS Spreadsheets

Calculate Half-Month Differences in WPS Spreadsheets

Use YEARFRAC and MROUND in WPS Spreadsheets to calculate and round the months between two dates.

  1. 1. Open a spreadsheet: Open WPS Spreadsheets and create a workbook or open an existing Excel file.
  2. 2. Enter the dates: Enter the start date in A1 and the end date in B1, using recognized date values.
  3. 3. Calculate months: Select an empty cell and enter =YEARFRAC(A1,B1,0)*12, then press Enter.
  4. 4. Round if needed: For half-month increments, replace the formula with =MROUND(YEARFRAC(A1,B1,0)*12,0.5).
Calculate fractional months with a worksheet formulaRound results to the nearest half monthOpen and edit Microsoft Excel XLS and XLSX filesUse familiar spreadsheet cells and formulas
microsoft office alternative - wps office

Frequently Asked Questions

Why does YEARFRAC return 7.5 for the example dates?

With basis 0, =YEARFRAC(A1,B1,0)*12 uses the US 30/360 convention. For May 16 through December 31, 2019, that calculation produces 7.5 months.

How do I round a month difference to the nearest half month?

Enter =MROUND(YEARFRAC(A1,B1,0)*12,0.5) in the result cell. The 0.5 argument sets the rounding increment.

How can I count only complete months?

Enter =DATEDIF(A1,B1,"m"), with the earlier date in A1 and the later date in B1. This excludes any incomplete month.

Does the YEARFRAC formula always treat the 16th as a half-month boundary?

No. YEARFRAC calculates a fraction using a day-count convention, and MROUND rounds that result. A fixed cutoff rule may require a different formula.