COUPDAYBS Function (OpenOffice Calc)
Count coupon days before settlement with Apache OpenOffice COUPDAYBS. Check schedule anchoring, settlement on a coupon date and basis-dependent reconciliation.
Verification status: Eight ordinary reference formulas were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, through generated native ODF and GUI hard recalculation. Saved identities, inputs and results were checked. How formula examples are checked
Quick answer: =COUPDAYBS(DATE(2024;3;15);DATE(2025;12;31);2;0) returned 75 in the tested Apache OpenOffice 4.1.16 build.
Availability and version history
- Introduced: First release not established; documented by OpenOffice.org 3.3.
- Supported in: Apache OpenOffice 4.1.16; this is a verified release, not a final supported version.
- Scope: Desktop Calc, English function names and semicolon-separated formulas.
- Checked: October 14, 2026. Eight ordinary reference formulas were recalculated from generated ODF in 4.1.16 on Linux x86-64, Build 9816. Source and independent arithmetic were checked.
What COUPDAYBS returns
COUPDAYBS returns the day-count distance from the previous coupon date to settlement. The previous date can equal settlement. It is not the remaining days to maturity and not the number of coupon payments. Release implementation.
Syntax and arguments
COUPDAYBS(Settlement;Maturity;Frequency[;Basis])
- Settlement: date at which the regular coupon schedule is evaluated.
- Maturity: later final coupon date; the schedule is anchored to this date.
- Frequency: 1, 2 or 4 payments per year.
- Basis: optional, defaults to 0: US 30/360. Other values are 1 actual/actual, 2 actual/360, 3 actual/365 and 4 European 30/360. The functions implement the release-specific rules discussed below.
Eight reproducible examples
The native column contains saved 4.1.16 results; independent references use high-precision arithmetic and the stated source rules. Values are shown to twelve decimal places where needed. Enter DATE expressions directly rather than locale-dependent date text.
| Formula | Native 4.1.16 result | Independent reference |
|---|---|---|
=COUPDAYBS(DATE(2024;3;15);DATE(2025;12;31);2;0) |
75 |
75 |
=COUPDAYBS(DATE(2024;3;15);DATE(2025;12;31);2;1) |
75 |
75 |
=COUPDAYBS(DATE(2024;3;15);DATE(2025;12;31);2;2) |
75 |
75 |
=COUPDAYBS(DATE(2024;3;15);DATE(2025;12;31);2;3) |
75 |
75 |
=COUPDAYBS(DATE(2024;3;15);DATE(2025;12;31);2;4) |
75 |
75 |
=COUPDAYBS(DATE(2024;6;30);DATE(2025;12;31);2;1) |
0 |
0 |
=COUPDAYBS(DATE(2024;3;15);DATE(2025;2;28);1;0) |
15 |
15 |
=COUPDAYBS(DATE(2024;1;15);DATE(2025;12;31);4;1) |
15 |
15 |
Practical worksheet
For settlement March 15, 2024, maturity December 31, 2025 and semiannual coupons, the preceding coupon date is December 31, 2023. The elapsed count is 75 in each of the five tested bases for these particular endpoints. Equal outputs here do not mean the bases are interchangeable on all dates.
When settlement is exactly June 30, 2024 on the same semiannual schedule, the preceding coupon date is settlement itself and the elapsed count is 0. For quarterly coupons and settlement January 15, 2024, the previous date is December 31, 2023 and the actual elapsed count is 15.
Advanced interpretation and checks
For the March 15 semiannual example, basis 0 has 75 elapsed units and 105 remaining units, totaling its 180-unit period. Under basis 1, the corresponding counts are 75 and 107, totaling the actual 182-day period.
Do not assume this sum equals COUPDAYS for bases 2 or 3. Their elapsed and remaining counts use actual dates, while COUPDAYS uses 360/Frequency or 365/Frequency. In this example the actual parts total 182, whereas those denominators are 180 and 182.5. This distinction matters when constructing an accrual fraction.
Boundaries and troubleshooting
The source locates the previous coupon by stepping backward in whole coupon months from a maturity-anchored schedule. It preserves the maturity month-end convention rather than subtracting a fixed number of calendar days. An annual February-end example gives a previous date of February 29, 2024 and an elapsed count of 15 at March 15.
Settlement must precede maturity, and frequency and basis must be valid. The native cases use chronological date-only values; invalid dates, fractional serial conversion and irregular first/last coupon schedules were not executed. These helpers describe a regular schedule, not every bond’s contractual accrual method.
Related functions
Official evidence and checking scope
- Function-specific release implementation
- GetCoupdaybs schedule/date helper
- lcl_GetCouppcd schedule/date helper
- ScaDate::setDay schedule/date helper
- ScaDate::getDate schedule/date helper
- ScaDate::getDiff schedule/date helper
- Maturity month-end preservation
- Optional basis conversion and validation
The generated ODF produced the informational load warning “Not all attributes could be read.” The sheet was hard-recalculated and saved separately. All eight ordinary function identities, inputs and results were reconciled; a stale SUM cache changed from 999999 to 3 and an uncached SUM returned 7. This establishes the stated examples, not every workbook style or invalid input. Other explanatory identities are independent calculations. The authoring-tool XLSX was not executed in OpenOffice, and its preview values are not the native results reported here.