COUPNUM Function (LibreOffice Calc)
The COUPNUM function returns the number of coupon periods between the settlement date and the maturity date. It is essential for bond valuation, yield calculations, and financial modeling involving coupon schedules.
Verification status: Consult the documentation, examples and any stated test scope below. How formula examples are checked
Availability and version history
- Introduced: Documented by LibreOffice 26.8.1.1; original introduction not established.
- Availability: Supported in LibreOffice 26.8.1.1, verified against its function registry. This identifies a supported release, not a final working version.
- Scope: Desktop Calc, using the English function name. Availability in other spreadsheet applications is separate.
- Checked: 2026-10-14 — function reference; versioned support. Documentation/source check; not a new native test. Existing example-specific test claims below retain their stated scope.
What the COUPNUM Function Does
- Returns the count of coupon periods between settlement and maturity
- Uses coupon frequency (annual, semiannual, quarterly)
- Supports multiple day‑count basis systems
- Works with real dates, serial numbers, and DATEVALUE
It is designed to be precise, finance‑grade, and Excel‑compatible.
Syntax
COUPNUM(settlement; maturity; frequency; [basis])
Arguments
-
settlement:
The date the security is traded to the buyer. -
maturity:
The date the security matures. -
frequency:
Number of coupon payments per year:1= annual2= semiannual4= quarterly
-
basis (optional):
Day-count convention:
| basis | Day-count convention |
|---|---|
| 0 | US 30/360 |
| 1 | Actual/Actual |
| 2 | Actual/360 |
| 3 | Actual/365 |
| 4 | European 30/360 |
Basic Examples
Number of coupon periods (semiannual)
=COUPNUM("2024-03-15"; "2026-03-15"; 2)
Using Actual/Actual
=COUPNUM(A1; A2; 2; 1)
Using text dates
=COUPNUM(DATEVALUE(A1); DATEVALUE(A2); 2)
Advanced Examples
Quarterly coupon periods
=COUPNUM("2024-02-10"; "2025-02-10"; 4)
From imported CSV timestamps
=COUPNUM(DATEVALUE(LEFT(A1;10)); DATEVALUE(LEFT(A2;10)); Frequency)
From Excel serial dates stored as text
=COUPNUM(DATE(1899;12;30)+VALUE(A1); DATE(1899;12;30)+VALUE(A2); Frequency)
Combine with COUPPCD and COUPNCD to build a full coupon schedule
=COUPNUM(A1; A2; Freq)
Determine if a bond has only one coupon remaining
=COUPNUM(A1; A2; Freq) = 1
Use in yield calculations
=YIELD(Settlement; Maturity; Rate; Price; Redemption; Freq; Basis)
Use in price calculations
=PRICE(Settlement; Maturity; Rate; Yield; Redemption; Freq; Basis)
Edge Cases and Behavior Details
COUPNUM returns an integer
Accepts:
- Real dates
- Serial numbers
- DATEVALUE outputs
Invalid text → Err:502
Behavior details
- Settlement < Maturity must hold
- Frequency must be 1, 2, or 4
- Basis must be 0–4
- Coupon schedule is calculated backward from maturity
- Time components ignored
COUPNUM of an error → error propagates
Common Errors and Fixes
Err:502 — Invalid argument
Cause:
- Dates not recognized
- Frequency not 1, 2, or 4
- Basis outside 0–4
Fix:
- Wrap dates with DATEVALUE
- Validate frequency and basis
Err:504 — Invalid date sequence
Cause:
- Settlement after maturity
Fix:
- Correct date order
Unexpected coupon count
Cause:
- Wrong frequency
- Incorrect maturity date
- Wrong day-count basis
Fix:
- Verify coupon schedule
- Confirm basis selection
Best Practices
- Use Actual/Actual (basis 1) for government bonds
- Use 30/360 for corporate bonds
- Normalize text dates with DATEVALUE
- Validate coupon frequency carefully
- Use COUPNUM with COUPDAYS, COUPDAYSNC, COUPPCD, and COUPNCD for full coupon modeling
Related Patterns and Alternatives
- Use COUPDAYS for total days in coupon period
- Use COUPDAYSNC for days to next coupon
- Use COUPPCD for previous coupon date
- Use COUPNCD for next coupon date
- Use ACCRINT for accrued interest
- Use PRICE and YIELD for bond valuation
By mastering COUPNUM and its companion functions, you can build powerful, accurate, and fully professional fixed‑income models in LibreOffice Calc.