Calculate Half-Month Differences Between Dates in Excel
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.
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.
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.
Type 5/16/2019 in cell A1 and 12/31/2019 in cell B1.
Select an empty cell, enter =YEARFRAC(A1,B1,0)*12, and press Enter. The example returns 7.5.
To round other results to the nearest 0.5 month, enter =MROUND(YEARFRAC(A1,B1,0)*12,0.5) in the result cell.

Count complete months with DATEDIF
Use DATEDIF when only fully completed months should count, without a fractional month.
Calculate Half-Month Differences in WPS Spreadsheets
Use YEARFRAC and MROUND in WPS Spreadsheets to calculate and round the months between two dates.
- 1. Open a spreadsheet: Open WPS Spreadsheets and create a workbook or open an existing Excel file.
- 2. Enter the dates: Enter the start date in A1 and the end date in B1, using recognized date values.
- 3. Calculate months: Select an empty cell and enter =YEARFRAC(A1,B1,0)*12, then press Enter.
- 4. Round if needed: For half-month increments, replace the formula with =MROUND(YEARFRAC(A1,B1,0)*12,0.5).

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.




