COUPNUM(settlement, maturity, frequency, [basis]) returns the number of coupons payable
between the settlement date and the maturity date. Microsoft's Learn page adds the decisive
clause: "rounded up to the nearest whole coupon".
That clause is the whole definition. A bond settled part-way through a coupon period still has
that period's coupon ahead of it, so a partial period counts as a whole one. Equivalently, on
the schedule described on COUPNCD — coupon dates counted
backwards from maturity in 12/frequency-month steps — COUPNUM is the number of schedule
dates strictly after settlement, up to and including maturity.
When it returns a number, that number is a positive integer, and it is the number of terms in
the cash-flow sums that PRICE, YIELD, DURATION and MDURATION evaluate. An off-by-one here is
an off-by-one coupon in every one of them.
The relationship to the rest of the family:
COUPNUM = 1 + (whole coupon periods between COUPNCD and maturity)
so the first of the counted coupons falls on COUPNCD and the last on
maturity.
Arguments
COUPNUM(settlement, maturity, frequency, [basis]) — the family's shared four arguments, with
Microsoft's wording quoted on COUPDAYBS.
Argument
Meaning
Required?
settlement
The security's settlement date.
Required
maturity
The security's maturity date.
Required
frequency
Coupon payments per year: 1, 2 or 4.
Required
basis
The day-count basis, 0–4.
Optional, defaults to 0
The standard five-row basis table is documented on this page — 0 or omitted = US (NASD) 30/360,
1 = actual/actual, 2 = actual/360, 3 = actual/365, 4 = European 30/360.
basis cannot change the answer. Counting coupon dates is calendar arithmetic; no
day-count convention adds or removes a date from the schedule. basis is nevertheless validated
and an out-of-range value turns a well-defined count into an error — the same
non-participating-but-fatal argument that appears on COUPNCD and
COUPPCD.
Microsoft documents that "All arguments are truncated to integers."
Try it
Quirks
Result and edge cases
Returns a Number: a positive integer, or #NUM! when the coupon before settlement falls before
1900 (FN-COUPNUM-001).
settlement one day before maturity returns 1: the maturity coupon.
The answer is independent of basis on every input where it is defined.
settlement ≥ maturity is a documented error, which is why the answer is never 0.
Month-end maturities change which dates the coupons fall on but not how many there are,
except at the boundary where a shifted date crosses settlement.
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
COUPNUM is #NUM! when the coupon before settlement falls before 1900
If the coupon date before settlement, counted back from maturity, falls before 1 January 1900, COUPNUM gives #NUM!. The other coupon functions still answer for the same inputs: COUPPCD returns 0, COUPNCD the next coupon, and COUPDAYS, COUPDAYBS and COUPDAYSNC a day count. With maturity serial 400 (1901-02-03) and semi-annual coupons, the coupon dates are serials 34 and 216: settlement 33 gives #NUM!, settlement 34 gives 2. With maturity 367, settlement 0 gives #NUM! and settlement 1 gives 2. This covers settlement 0 too: COUPNUM(0,m,2,0) was #NUM! for every maturity read.
Formula
Excel
Mathematical value
COUPNUM(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
#NUM!
—
COUPNUM(34, 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: 34 0x4041000000000000
maturity: 400 0x4079000000000000
frequency: 2 0x4000000000000000
basis: 0 0x0000000000000000
2 0x4000000000000000
—
COUPNUM(0, 367, 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: 0 0x0000000000000000
maturity: 367 0x4076f00000000000
frequency: 2 0x4000000000000000
basis: 0 0x0000000000000000
#NUM!
—
=COUPNUM(0,182,2,0) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Typed formula.
#NUM!
—
=COUPNUM(A1,400,2,0) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Number supplied through a cell.
A1: 0 0x0000000000000000
#NUM!
—
=COUPPCD(A1,400,2,0) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
Number supplied through a cell.
A1: 0 0x0000000000000000
0 0x0000000000000000
—
=COUPNCD(A1,400,2,0) Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZAInputs and reference value
The answer is an integer and should be computed as one. Deriving it from a year fraction
and rounding is the classic way to introduce an off-by-one at period boundaries: a
floating-point year fraction that lands a hair below an integer rounds the wrong way.
The roll-forward branch changes the answer by a whole unit, and the limit at 1900 in
FN-COUPNUM-001 is a second boundary. The branch is decided before any counting, and it is shared
with the rest of the family — one probe fixes all six functions.
Cost is linear in the answer. For a synthetic instrument maturing centuries out, an
iterating implementation does real work; a consumer computing COUPNUM inside a solver loop
will feel it.
Validate basis and ignore it. There is nothing for a day-count routine to do here.
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
COUPNUM(33, 400, 2, 0) returned #NUM!. COUPNUM(34, 400, 2, 0) returned 2 (0x4000000000000000). 1 further recorded control is attached. Inputs were supplied through cells using Value2. These are controls from this environment, not a same-input comparison with another build.
Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA
=COUPNUM(0,182,2,0) returned #NUM!. =COUPNUM(A1,400,2,0) returned #NUM!. Inputs were supplied through cells using Value2, formula literals. These are controls from this environment, not a same-input comparison with another build.
Observed formulas and results
=COUPNUM(0,182,2,0) → #NUM!(formula-literal)
=COUPNUM(A1,400,2,0) → #NUM!(cell-value2)
Excel 16.0 build 20131
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
COUPNCD — the date of the first of the counted coupons, and the page
that hosts the shared schedule description.
COUPPCD — the date of the coupon not counted, immediately before
settlement.
COUPDAYS, COUPDAYBS,
COUPDAYSNC — the day counts within the first of the remaining
periods. COUPNUM counts whole periods; those three subdivide the current one.
PRICE, YIELD, DURATION, MDURATION — the consumers. Each evaluates a sum with
COUPNUM terms, discounted at exponents built from COUPDAYSNC / COUPDAYS plus whole
periods.
NPER — the annuity-count function, which answers a superficially similar question
(how many periods) from rates and payments rather than from dates. The two are not
substitutes.
Confused with: (maturity − settlement) / 365 × frequency rounded up, which agrees with
COUPNUM most of the time and disagrees exactly where the schedule's month arithmetic
matters.