DURATION Function (LibreOffice Calc)
The DURATION function returns the Macaulay duration of a security that pays periodic interest. It is used in fixed-income modeling, bond analytics, and interest-rate risk measurement.
Compatibility
▾| Excel | ✔ |
| Gnumeric | ✔ |
| Google_sheets | ✔ |
| Libreoffice | ✔ |
| Numbers | ✔ |
| Onlyoffice | ✔ |
| Openoffice | ✔ |
| Wps | ✔ |
| Zoho | ✔ |
What the DURATION Function Does â–¾
- Computes Macaulay duration
- Uses settlement date, maturity date, coupon rate, and yield
- Supports all standard day‑count conventions
- Works with periodic coupon payments
- Essential for fixed‑income analytics and risk modeling
Syntax â–¾
DURATION(settlement; maturity; coupon; yield; frequency; [basis])
Arguments
-
settlement:
Date the bond is purchased. -
maturity:
Date the bond matures. -
coupon:
Annual coupon rate (e.g., 0.05 for 5%). -
yield:
Annual yield to maturity. -
frequency:
Number of coupon payments per year:- 1 = annual
- 2 = semiannual
- 4 = quarterly
-
basis (optional):
Day‑count convention:- 0 = US 30/360
- 1 = Actual/Actual
- 2 = Actual/360
- 3 = Actual/365
- 4 = European 30/360
Basic Examples â–¾
Semiannual coupon bond
=DURATION("2026-01-01"; "2031-01-01"; 0.05; 0.04; 2)
→ Macaulay duration in years
Quarterly coupon bond with Actual/Actual
=DURATION(A1; A2; 0.06; 0.055; 4; 1)
Annual coupon bond
=DURATION(A1; A2; 0.03; 0.035; 1)
Advanced Examples â–¾
Combine with MDURATION for modified duration
=MDURATION(A1; A2; coupon; yield; frequency; basis)
Compute interest‑rate sensitivity (DV01 approximation)
=PRICE(A1; A2; coupon; yield - 0.0001; frequency; basis)
- PRICE(A1; A2; coupon; yield + 0.0001; frequency; basis)
Use with COUPNUM to validate coupon structure
=COUPNUM(settlement; maturity; frequency; basis)
Build a full bond analytics block
Duration: =DURATION(...)
Mod Duration: =MDURATION(...)
Convexity: =... (manual or custom)
Yield: =YIELD(...)
Price: =PRICE(...)
Use in portfolio‑weighted duration
=SUMPRODUCT(weights; durations)
Edge Cases and Behavior Details â–¾
DURATION returns a number in years
Behavior details
- settlement < maturity
- coupon and yield expressed as decimals
- frequency must be 1, 2, or 4
- basis must be 0–4
- Uses Macaulay duration, not modified duration
- Requires valid coupon schedule (no irregular first/last periods)
Invalid input → Err:502
Common Errors and Fixes â–¾
Err:502 — Invalid argument
Cause:
- settlement ≥ maturity
- frequency not 1, 2, or 4
- basis outside 0–4
- invalid date
Fix:
- Validate dates
- Use DATE() for construction
- Ensure frequency is correct
Duration seems too low or too high
Cause:
- Incorrect yield or coupon
- Wrong day‑count basis
- Irregular coupon structure
Fix:
- Verify basis
- Confirm coupon frequency
- Use COUPDAYS/COUPNUM to inspect schedule
Best Practices â–¾
- Use MDURATION when modeling price sensitivity
- Use DURATION for theoretical Macaulay duration
- Always specify basis for fixed‑income accuracy
- Validate coupon schedules with COUP* functions
- Use consistent date formats (DATE(Y;M;D))
DURATION is one of the core fixed‑income analytics functions — essential for interest‑rate risk, bond pricing, and portfolio immunization.
Related Patterns and Alternatives â–¾
- MDURATION — modified duration
- PRICE / YIELD — bond pricing
- COUPDAYS / COUPNUM / COUPPCD / COUPNCD — coupon schedule
- PV / RATE / NPER — time‑value functions
- Custom convexity formulas — advanced analytics
By mastering DURATION, you can build professional‑grade fixed‑income models and risk analytics in LibreOffice Calc.