COUPDAYBS Function (LibreOffice Calc)

Financial Advanced LibreOffice Calc Introduced in LibreOffice 3.0
bonds fixed-income coupon-schedule day-count financial-modeling

The COUPDAYBS function returns the number of days from the beginning of the coupon period to the settlement date. It is used in fixed‑income modeling, bond pricing, and coupon‑schedule calculations.

Compatibility

What the COUPDAYBS Function Does

  • Returns the number of days from:
    • Coupon period startSettlement date
  • Uses standard day‑count conventions
  • Supports annual, semiannual, and quarterly coupon frequencies
  • Used in pricing, yield, and accrued‑interest calculations

Syntax

COUPDAYBS(settlement; maturity; frequency; [basis])

Arguments

  • settlement:
    The date the bond is traded/settled.

  • maturity:
    The bond’s maturity date.

  • frequency:
    Number of coupon payments per year:

    • 1 = annual
    • 2 = semiannual
    • 4 = quarterly
  • basis (optional):
    Day‑count basis:

    • 0 = US 30/360
    • 1 = Actual/Actual
    • 2 = Actual/360
    • 3 = Actual/365
    • 4 = European 30/360

Basic Examples

Semiannual coupon, Actual/Actual

=COUPDAYBS("2026-04-01"; "2030-10-01"; 2; 1)

Quarterly coupon, 30/360

=COUPDAYBS(A1; A2; 4; 0)

Annual coupon, Actual/365

=COUPDAYBS("2025-06-15"; "2035-06-15"; 1; 3)

Advanced Examples

Use with COUPDAYS to compute accrual fraction

=COUPDAYBS(A1; A2; 2; 1) / COUPDAYS(A1; A2; 2; 1)

Build a full coupon schedule

=COUPDAYBS(settlement; maturity; frequency; basis)

paired with:

=COUPPCD(settlement; maturity; frequency; basis)
=COUPNCD(settlement; maturity; frequency; basis)

Compute accrued interest manually

= (COUPDAYBS(A1;A2;2;0) / COUPDAYS(A1;A2;2;0)) * coupon_rate * face_value

Validate settlement before maturity

=IF(A1 < A2; COUPDAYBS(A1;A2;2;1); "Invalid")

Edge Cases and Behavior Details

COUPDAYBS returns a number of days

Behavior details

  • Settlement must be after the previous coupon date
  • Settlement must be before maturity
  • Frequency must be 1, 2, or 4
  • Basis affects day‑count calculation
  • Uses internally computed coupon boundaries (PCD/NCD)

Invalid inputs → Err:502

  • Settlement ≥ maturity
  • Invalid frequency
  • Invalid basis
  • Non‑date inputs

Common Errors and Fixes

Err:502 — Invalid argument

Cause:

  • Settlement ≥ maturity
  • Frequency not in {1,2,4}
  • Basis outside 0–4
  • Non‑date values

Fix:

  • Validate date order
  • Use correct frequency
  • Use valid basis

Wrong day count

Cause:

  • Incorrect basis assumption

Fix:

  • Confirm basis with bond documentation

Best Practices

  • Always pair COUPDAYBS with COUPDAYS and COUPDAYSNC
  • Use Actual/Actual (basis 1) for government bonds
  • Use 30/360 (basis 0 or 4) for corporate bonds
  • Validate settlement < maturity before computing
  • Use DATE() instead of text dates for reliability
COUPDAYBS is one of the core building blocks of fixed‑income modeling — it defines the starting point of the accrual period used in pricing, yield, and interest calculations.

Related Patterns and Alternatives

  • COUPDAYS — total days in coupon period
  • COUPDAYSNC — days from settlement to next coupon
  • COUPNUM — number of coupon periods
  • COUPPCD / COUPNCD — coupon boundary dates
  • ACCRINT / ACCRINTM — accrued interest
  • PRICE / YIELD — bond pricing

By mastering COUPDAYBS, you can build precise, professional‑grade fixed‑income models in LibreOffice Calc.

Copyright 2026. All rights reserved.