COUPDAYBS(settlement, maturity, frequency, [basis]) returns the number of days from the
beginning of the current coupon period to the settlement date — the days the seller has
already earned.
Its whole economic purpose is one quotient:
accrued interest = coupon × COUPDAYBS / COUPDAYS
which is why the denominator's page, COUPDAYS, is required reading alongside
this one: the two functions do not measure time the same way on every basis.
The "beginning of the current coupon period" is the previous coupon date, which is exactly what
COUPPCD returns. The period is derived from the schedule described on
COUPNCD — coupon dates counted backwards from maturity
in 12/frequency-month steps.
"The security's settlement date. The security settlement date is the date after the issue date when the security is traded to the buyer."
Required
maturity
"The security's maturity date. The maturity date is the date when the security expires."
Required
frequency
"The number of coupon payments per year. For annual payments, frequency = 1; for semiannual, frequency = 2; for quarterly, frequency = 4."
Required
basis
"The type of day count basis to use."
Optional, defaults to 0
The five-row basis table is documented on this page and is the standard one — 0 or omitted = US
(NASD) 30/360, 1 = actual/actual, 2 = actual/360, 3 = actual/365, 4 = European 30/360.
There is no issue date argument. A security issued mid-period does not shorten the first
COUPDAYBS: the function measures from the schedule's previous coupon date, real or notional,
not from issuance. Accrued interest on a newly issued bond therefore needs
ACCRINT, which does take an issue date, rather than this function.
Microsoft documents that "All arguments are truncated to integers." Dates should be produced
by DATE or by other formulas rather than typed as text; ordinary coercion rules are in
Coercion and lifting.
Try it
Quirks
How the days are counted
basis
How COUPDAYBS counts
0 — US (NASD) 30/360
30/360-adjusted day count
1 — Actual/actual
actual calendar days
2 — Actual/360
actual calendar days
3 — Actual/365
actual calendar days
4 — European 30/360
30/360-adjusted day count
So COUPDAYBSis a calendar measurement on three of the five bases, and a 30/360 measurement
on the other two. It is never a declared constant — which is precisely where it parts company
with COUPDAYS, and why
COUPDAYBS + COUPDAYSNC = COUPDAYS
holds on bases 1 and 4 and fails on bases 2 and 3. On basis 0 it does not always hold: there
FN-COUPDAYSNC-001 measures COUPDAYSNC as P − A, and P need not be 360/frequency. The full
account of the failure on bases 2 and 3, and of the upstream case where Excel's own PRICE and
COUPDAYSNC disagreed because of it, is on
COUPDAYS.
Result and edge cases
Returns a Number: a day count, integral on every basis.
settlement one day after a coupon date returns 1 on bases 1, 2 and 3, and 1 on the
30/360 bases too except where the adjustment rules bite.
The 30/360 bases can disagree with the calendar by several days, by design: a period from
31 January to 31 July counts as 180 days on basis 0 whatever the calendar says.
The result is bounded by the period length only on bases 0, 1 and 4. On bases 2 and 3 the
count can exceed the COUPDAYS the same call reports, because that denominator is a
convention.
settlement ≥ maturity is a documented error.
Empty, missing and error arguments follow the shared call model; see
The value universe.
Errors
Documented on Microsoft's Learn page for this function, in these words (it says "generates an
error" without naming a worksheet error value):
Condition (documented)
Documented outcome
settlement or maturity is not a valid date
error
frequency is any number other than 1, 2 or 4
error
basis < 0 or basis > 4
error
settlement ≥ maturity
error
On basis 0 COUPDAYSNC is not always COUPDAYS minus COUPDAYBS
On basis 0 (US 30/360), COUPDAYSNC is P - A. A is COUPDAYBS, the accrued days. P is a 30/360 count between the actual previous and next coupon dates, with day 31 and the last day of February both counted as day 30. COUPDAYS on basis 0 is always 360/frequency, but P need not be: when a coupon falls on the last day of February and maturity is not a month end, P can be 88, 89 or 92 for a quarter and 178 or 182 for a half year. So COUPDAYSNC(39923,50919,4,0), with coupons 2009-02-28 and 2009-05-29, is 39: P is 89 and A is 50, where 90 - 50 would give 40. With no coupon date before settlement in Excel's calendar, the period starts at serial 0: COUPDAYSNC(33,400,2,0) is 1, and for settlement 61, maturity 456 and annual coupons COUPDAYBS plus COUPDAYSNC is 90, not 360. This rule matches all 1,664 recorded number rows on basis 0, 733 of them chosen near February, month ends and the start of the calendar.
Explanation (inferred): The split into P and A reproduces every row; that Excel's code forms these two counts is inferred. For the February cases in this note only COUPDAYSNC is recorded: their A comes from the rule, not from a COUPDAYBS reading.
Formula
Excel
Mathematical value
COUPDAYSNC(39923, 50919, 4, 0) Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading fileInputs and reference value
Number supplied through a cell.
settlement: 39923 0x40e37e6000000000
maturity: 50919 0x40e8dce000000000
frequency: 4 0x4010000000000000
basis: 0 0x0000000000000000
39 0x4043800000000000
—
COUPDAYSNC(45986, 57038, 2, 0) Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading fileInputs and reference value
Number supplied through a cell.
settlement: 45986 0x40e6744000000000
maturity: 57038 0x40ebd9c000000000
frequency: 2 0x4000000000000000
basis: 0 0x0000000000000000
95 0x4057c00000000000
—
COUPDAYSNC(46478, 46627, 4, 0) Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading fileInputs and reference value
Number supplied through a cell.
settlement: 46478 0x40e6b1c000000000
maturity: 46627 0x40e6c46000000000
frequency: 4 0x4010000000000000
basis: 0 0x0000000000000000
57 0x404c800000000000
—
COUPDAYSNC(33, 400, 2, 0) Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading fileInputs and reference value
Number supplied through a cell.
settlement: 33 0x4040800000000000
maturity: 400 0x4079000000000000
frequency: 2 0x4000000000000000
basis: 0 0x0000000000000000
1 0x3ff0000000000000
—
COUPDAYBS(61, 456, 1, 0) Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading fileInputs and reference value
Number supplied through a cell.
settlement: 61 0x404e800000000000
maturity: 456 0x407c800000000000
frequency: 1 0x3ff0000000000000
basis: 0 0x0000000000000000
61 0x404e800000000000
—
COUPDAYSNC(61, 456, 1, 0) Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading fileInputs and reference value
This is integer arithmetic pretending to be floating point. Every answer is a whole
number of days on every basis. An implementation that computes it in integers and converts
once at the end has no rounding to discuss; one that routes through a year fraction and
multiplies back does.
The order of the two 30/360 adjustments is observable. Collapsing the 31st to the 30th
before or after noticing that the start date was a month end changes the answer by a day on a
nameable input class — and only on that class, which is why it survives large corpora and
then fails in production.
The roll-forward convention is a branch, not a formula. Whether settlement on a coupon
date yields 0 or a full period is decided before any counting happens, and it is the largest
single behavioural unknown on this page.
No cancellation, no overflow, no transcendental. The difficulty here is entirely
definitional.
Rust code
Show the CalcFunc source of this function
Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.
No implementation has been published with a Handbook test suite for this function.
Version differences
The recorded environments below distinguish a reading from a same-input comparison. Counts describe captured inputs in each environment; overlapping captures and comparisons are not totals of unique worksheet calls.
Excel 16.0 build
Platform and CPU
Captured inputs
20131
Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics
1,060
20430
Windows, 64-bit, AMD Ryzen 7 4800H with Radeon Graphics
3,012
The record contains no same-input comparison between these environments. Reading different inputs on different builds does not establish either a version change or cross-build agreement.
Windows, bitness and CPU not recorded in this reading file
COUPDAYBS(61, 456, 1, 0) returned 61 (0x404e800000000000). Inputs were supplied through cells using Value2. These are controls from this environment, not a same-input comparison with another build.
Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics
1,060 captured inputs are indexed for this environment. Capture dates: 2026-07-19 to 2026-07-19. This is a reading count, not a comparison with another build.
Excel 16.0 build 20430
Windows, 64-bit, AMD Ryzen 7 4800H with Radeon Graphics
3,012 captured inputs are indexed for this environment. Capture dates: 2026-09-24 to 2026-09-25. This is a reading count, not a comparison with another build.
Alternatives
Relationships
COUPDAYS — the denominator. Read its additivity section before
combining the two.
COUPDAYSNC — the complement, days from settlement forward to the
next coupon. The pair is not guaranteed to partition the period.
COUPPCD — the date this function counts from. settlement − COUPPCD is
the actual elapsed days, which equals COUPDAYBS on bases 1, 2 and 3 and not on 0 or 4.
ACCRINT — the function to use when accrual starts at issuance rather
than at a schedule coupon date, or when the interval spans several periods.
PRICE, YIELD — consumers. PRICE returns a clean price; the invoice price adds the
accrual this function's quotient defines.
YEARFRAC — the same day-count conventions, applied to an arbitrary
date pair instead of to a coupon period.
Confused with: settlement − COUPPCD(...) (above), and with ACCRINT, which answers a
different question with a different domain.