Financial functions

COUPNUM

Matches all 5,597 recorded answers

Recorded: 5,584 in the answer bank and 13 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicCOUPNUM
BulgarianCOUPNUM
CzechCOUPNUM
DanishKUPONBETALINGER
GermanCOUPNUM
GreekCOUPNUM
English (Australia)COUPNUM
English (United Kingdom)COUPNUM
English (United States)COUPNUM
SpanishCUPON.NUM
EstonianCOUPNUM
FinnishKORKOPÄIVÄ.JAKSOT
FrenchNB.COUPONS
HebrewCOUPNUM
CroatianCOUPNUM
HungarianSZELVÉNYSZÁM
IndonesianCOUPNUM
ItalianCOUPNUM
JapaneseCOUPNUM
KoreanCOUPNUM
LithuanianCOUPNUM
LatvianCOUPNUM
NorwegianCOUPNUM
DutchCOUP.AANTAL
PolishWYPŁ.LICZBA
Portuguese (Brazil)COUPNUM
Portuguese (Portugal)CUPNÚM
RomanianCOUPNUM
RussianЧИСЛКУПОН
SlovakCOUPNUM
SlovenianCOUPNUM
Serbian (Latin)COUPNUM
SwedishKUPANT
ThaiCOUPNUM
TurkishKUPONSAYI işlevi
UkrainianCOUPNUM
VietnameseCOUPNUM
Chinese (Simplified)COUPNUM
Chinese (Hong Kong)COUPNUM
Chinese (Traditional)COUPNUM

Names from Microsoft's support site.

What it does

COUPNUM(settlement, maturity, frequency, [basis])

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.

ArgumentMeaningRequired?
settlementThe security's settlement date.Required
maturityThe security's maturity date.Required
frequencyCoupon payments per year: 1, 2 or 4.Required
basisThe 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

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

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 dateerror
frequency is any number other than 1, 2 or 4error
basis < 0 or basis > 4error
settlement ≥ maturityerror

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.

FormulaExcelMathematical value
COUPNUM(33, 400, 2, 0)
Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file
Inputs 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 file
Inputs 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 file
Inputs 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-ZA
Inputs 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-ZA
Inputs 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-ZA
Inputs 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-ZA
Inputs and reference value

Number supplied through a cell.

A1: 0
0x0000000000000000

34
0x4041000000000000
—

Inputs, build details and evidence

How to implement

Numerical notes

  1. 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.
  2. 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.
  3. 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.
  4. 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.

COUPNUM · 4 lines · calc-func/src/catalogue/bonds.rs on GitHub
14 coupnum_fn "COUPNUM" (3, 4) [V "settlement", V "maturity", V "frequency", V "basis"] |s, a, sv| {
    let (settlement, maturity, frequency, b) = coupon_args(s, a, sv)?;
    coupon_out(s, coupon::coupnum_kernel(settlement, maturity, frequency, b))
}
coupnum_kernel · 15 lines · calc-func/src/ported/coupon_family.rs on GitHub
pub fn coupnum_kernel(
    settlement: f64,
    maturity: f64,
    frequency: f64,
    basis: Option<f64>,
) -> Result<f64, WorksheetErrorCode> {
    let ctx = parse_coupon_context(settlement, maturity, frequency, basis)?;
    let period = locate_coupon_period(ctx)?;
    // Argument errors are resolved before this calendar limit. Fn4 qd225..qd236 and
    // fn7 COUPPCD/COUPNUM paired controls retain the zero-previous-coupon boundary.
    if period.previous == 0 {
        return Err(WorksheetErrorCode::Num);
    }
    Ok(period.remaining_coupons as f64)
}

Kernels shared with other functions

Argument and result plumbing

  • fail catalogue/kit
  • num catalogue/kit

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 buildPlatform and CPUCaptured inputs
20131Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics1,060
20430Windows, 64-bit, AMD Ryzen 7 4800H with Radeon Graphics3,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.

Recorded environments and comparison details.

Excel 16.0.20527.20088

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.

Observed formulas and results
  • COUPNUM(33, 400, 2, 0) → #NUM! (cell-value2)
  • COUPNUM(34, 400, 2, 0) → 2
    0x4000000000000000 (cell-value2)
  • COUPNUM(0, 367, 2, 0) → #NUM! (cell-value2)

Excel 16.0.20527.20088

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.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents