Contact

MDURATION Function (LibreOffice Calc)

Financial Intermediate LibreOffice Calc

Calculate modified duration in LibreOffice Calc, compare coupon frequencies and day-count bases, and interpret a small yield-change sensitivity estimate.

Verification status: Eight ordinary MDURATION formulas were recalculated through XLSX import and separate ODS export in LibreOfficeDev 26.8.0.0.alpha0, build 2c87e51eeaa2b413ff4ae097b2705eea1995d8e5, using a forced-recalculation profile. Saved identities, numeric results and both controls were checked. This is headless development-build evidence; no stable-release, 26.8.1.1 or GUI execution is claimed. How formula examples are checked

Quick answer: =MDURATION(DATE(2025;1;1);DATE(2026;1;1);.05;.06;2;0) returned 0.958977521835 in the scoped LibreOffice development-build check below.

Availability and version history

  • Introduced: First release not established; documented by LibreOffice 3.3.
  • Supported in: LibreOffice 26.8 Help and 26.8.1.1 source. No retirement is established.
  • Scope: English desktop Calc formulas with semicolon separators; execution below used a development build.
  • Checked: October 14, 2026. Eight ordinary formulas were recalculated headlessly in LibreOfficeDev 26.8.0.0.alpha0, build 2c87e51eeaa2b413ff4ae097b2705eea1995d8e5. No stable-release or GUI execution is claimed.

What MDURATION calculates

MDURATION returns modified Macaulay duration in years for a fixed-coupon security with an assumed redemption value of 100. It combines the timing and present value of the remaining payments, then adjusts Macaulay duration by the yield per coupon period. A result near 0.959 is a sensitivity measure, not a price, a yield or a count of coupon payments. Function-specific Help.

Syntax and arguments

MDURATION(Settlement; Maturity; Coupon; Yield; Frequency [; Basis])
  • Settlement / Maturity: Numeric spreadsheet dates. Use DATE(year;month;day) to avoid locale-dependent date text; settlement should precede maturity.
  • Coupon / Yield: Annual decimal rates, such as 0.05 for 5%. Coupon determines cash payments; yield discounts them.
  • Frequency: 1, 2 or 4 payments per year.
  • Basis: Optional day-count convention; omitted means 0. The choices are listed below.
Basis Day-count convention
0 or omitted US 30/360 (NASD)
1 Actual/actual
2 Actual/360
3 Actual/365
4 European 30/360

Eight reproducible examples

All eight formulas were recalculated in the exact development build above. The independent column uses high-precision arithmetic; the final column is separately rounded from the saved native numeric value. Values are shown to at most twelve decimal places, so a last-place display difference is possible.

Formula Independent reference Saved development-build result
=MDURATION(DATE(2025;1;1);DATE(2026;1;1);.05;.06;2;0) 0.958977521835 0.958977521835
=MDURATION(DATE(2025;1;1);DATE(2026;1;1);.05;.06;2;1) 0.958977521835 0.958977521835
=MDURATION(DATE(2025;1;1);DATE(2026;1;1);.05;.06;2;2) 0.972461879979 0.972461879979
=MDURATION(DATE(2025;1;1);DATE(2026;1;1);.05;.06;2;3) 0.958977521835 0.958977521835
=MDURATION(DATE(2025;1;1);DATE(2026;1;1);.05;.06;2;4) 0.958977521835 0.958977521835
=MDURATION(DATE(2025;1;1);DATE(2026;1;1);.05;.06;1;0) 0.943396226415 0.943396226415
=MDURATION(DATE(2025;1;1);DATE(2026;1;1);.05;.06;4;0) 0.967025072289 0.967025072289
=MDURATION(DATE(2025;1;1);DATE(2026;1;1);0;.06;2;0) 0.970873786408 0.970873786408

Practical worksheet

Enter =DATE(2025;1;1) in A2, =DATE(2026;1;1) in B2, 0.05 in C2, 0.06 in D2 and 2 in E2. Then =MDURATION(A2;B2;C2;D2;E2;0) corresponds to the first tested case, approximately 0.958977521835 years.

For a small yield change entered in F2, =-MDURATION(A2;B2;C2;D2;E2;0)*F2 gives the usual first-order relative-price sensitivity estimate. With F2=0.001, the estimate is approximately −0.000958977522, or −0.0958977522%. This is a local approximation; it omits convexity and is not a guaranteed realized price movement. The sensitivity arithmetic was checked independently, not executed as a separate native formula.

Advanced interpretation and checks

For the first case, the two remaining payments are 2.5 at half a year and 102.5 at one year. Discount them by 1.03 and 1.03^2. Their weighted average time is approximately 0.98774684749 years; division by 1.03 gives the modified duration.

The retained duration helper weights payment times using its year fraction and coupon count. That matters even when dates look simple: Actual/360 gives 365/360 years for this one-year example, so basis 2 produces 0.972461879979, rather than the basis-0 result. The equality of bases 0, 1, 3 and 4 here is specific to these dates.

Changing frequency also changes payment timing and the yield-per-period adjustment. The annual, semiannual and quarterly cases therefore differ. The zero-coupon case has all value at maturity and gives 1/1.03, approximately 0.970873786408. Inspected implementation.

Boundaries and troubleshooting

Keep coupon and yield annualized while supplying the actual payment frequency. Do not divide them by frequency before calling the function. Do not interpret modified duration as the elapsed time to maturity or use it as the cash price.

These examples cover positive yields, standard frequencies and ordinary ordered dates. The financial wrapper’s complete validation branches were not available in the retained evidence, so this guide does not assign exact errors to invalid frequencies, dates or rates. The inspected duration helper and eight native observations support the ordinary calculation, not every exceptional input.

Official evidence and checking scope

The XLSX formulas were recalculated with a forced-recalculation profile and exported to a separate ODS file. The deliberately stale SUM cache changed to 3, and the uncached SUM returned 7. All eight function identities and numeric results were checked against the saved XML and independent calculations. The execution was headless in the exact development build named above; the separately inspected 26.8.1.1 source was not executed. Invalid-domain cases were not tested. The complete current financial wrapper was not available for inspection; the cited helper, registration, Help and successful ordinary cases do not establish every validation or coercion branch.