Contact

MDURATION Function in ONLYOFFICE Spreadsheet Editor: Syntax and Examples

Financial Intermediate ONLYOFFICE Spreadsheet Editor

Calculate modified duration and interpret a small-yield-change sensitivity estimate without confusing it with Macaulay duration.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer

=MDURATION(DATE(2026,12,15),DATE(2028,12,15),0.10,0.10,1,0) is expected to return approximately 1.73553719008. Modified duration adjusts Macaulay duration for the yield-compounding convention. In the fixed-cash-flow model, it provides a local approximation to relative price sensitivity to a small change in annual yield.

Syntax and units

=MDURATION(settlement, maturity, coupon, yld, frequency, [basis])

coupon and yld are annual rates, such as 0.10 for 10%. frequency is payments per year: 1, 2 or 4. The implementation performs the per-period conversion internally. The official help uses the same argument structure as DURATION; the source divides the shared Macaulay result by 1+yld/frequency.

Basis defaults to 0 when omitted. The documented codes are 0 US (NASD) 30/360, 1 actual/actual, 2 actual/360, 3 actual/365 and 4 European 30/360. Use DATE for unambiguous numeric dates, settlement strictly before maturity, and consistent monetary units. Brackets mark optional syntax and are not typed.

The result is a duration/sensitivity measure, not a percentage return, a currency amount or a count of payments. Yield changes used with it must be decimal annual-rate changes: ten basis points is 0.001, not 0.1.

Step-by-step: independently check the conversion

  1. Enter settlement =DATE(2026,12,15) in A2 and maturity =DATE(2028,12,15) in B2.
  2. Enter coupon 0.10, yield 0.10, frequency 1 and basis 0 in C2:F2.
  3. Put =MDURATION(A2,B2,C2,D2,E2,F2) in G2.
  4. Use numeric formatting and keep the annual yield convention next to the result.

The independent cash-flow calculation uses payments of 10 after one year and 110 after two years. Discounted at 10%, their present values are 9.09090909091 and 90.9090909091. The Macaulay weighted average is (1×9.09090909091+2×90.9090909091)/100 ≈ 1.90909090909 years. Dividing by 1.10 gives the expected 1.73553719008.

Formula Expected modified duration
=MDURATION(A2,B2,0.10,0.10,1,0) 1.73553719008 approximately
=MDURATION(A2,B2,0,0.10,1,0) 1.81818181818 approximately
=MDURATION(A2,B2,0.10,0,1,0) 1.91666666667 approximately
=MDURATION(A2,B2,0.06,0.04,2,0) 1.87853615393 approximately
=MDURATION(A2,B2,0.10,0.10,1) Same main result, default basis 0

At zero yield the divisor is 1, so Macaulay and modified duration coincide. For the semiannual control, Macaulay duration is approximately 1.91610687701 and the divisor is 1+0.04/2=1.02. Frequency affects both discounting and the adjustment; it is not merely a label.

Advanced case: a bounded price-sensitivity illustration

For the main fictional cash-flow model, the local approximation is relative price change ≈ −modified duration × yield change. A yield increase of 0.001 gives approximately −0.00173553719008, or −0.173553719008%. Applied to the model present value 100, that suggests a decrease of about 0.173553719008.

This is a first-order approximation derived from the fixed-cash-flow present-value formula. It is not an exact price forecast: convexity matters as yield changes grow, and real securities can have changing cash flows, credit effects or different yield-curve movements. The source’s model uses regular coupons and normalized redemption 100; it has no call or option parameters.

For an independent check, revalue the same two payments at the changed yield with 10/(1+0.101)+110/(1+0.101)^2 and compare with the original 100. The difference will be close to, but not exactly, the linear estimate. Keep that distinction visible rather than rounding both into apparent equality.

Errors and schedule limits

The inspected wrapper rejects negative coupon or yield, settlement at/after maturity, invalid frequency and invalid basis with #NUM! after conversion. Zero coupon and zero yield are supported. Date serials, frequency and basis are floored; do not rely on accidental fractional inputs.

The shared duration helper uses a coupon-period fraction derived from COUPDAYS and COUPDAYBS between coupon dates. Its actual/360 and actual/365 denominator conventions must not be replaced casually with calendar-year fractions. The examples settle exactly on a coupon boundary and use day15 to avoid month-end ambiguity. Irregular periods, leap-day anchors, business-day adjustments and imported file behavior need their own verification.

Availability and verification scope

Checked October 18, 2026 against the official MDURATION help and official SDKJS source tagged v10.0.0.169. Desktop Editors 10.0 was released October 13, 2026. The original introduction version for this individual function is not established; current help does not mark it retired or deprecated.

All results in this guide are expected values from documentation, source inspection and independent arithmetic, not application observations. Neither the application nor its calculation engine was used to test these examples. The tag matches the installed version/build designation but does not establish identical behavior in every older release, mobile client, server deployment or imported workbook. Examples use English names and comma argument separators; adapt separators to editor settings. These fictional calculations explain a function, not an investment or borrowing recommendation.