Financial functions

COUPDAYSNC

Matches all 5,591 recorded answers

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

Local names in 40 languages
LanguageName in Excel
ArabicCOUPDAYSNC
BulgarianCOUPDAYSNC
CzechCOUPDAYSNC
DanishKUPONDAGE.ANK
GermanCOUPDAYSNC
GreekCOUPDAYSNC
English (Australia)COUPDAYSNC
English (United Kingdom)COUPDAYSNC
English (United States)COUPDAYSNC
SpanishCUPON.DIAS.L2
EstonianCOUPDAYSNC
FinnishKORKOPÄIVÄT.SEURAAVA
FrenchNB.JOURS.COUPON.SUIV
HebrewCOUPDAYSNC
CroatianCOUPDAYSNC
HungarianSZELVÉNYIDŐ.KIFIZETÉSTŐL
IndonesianCOUPDAYSNC
ItalianCOUPDAYSNC
JapaneseCOUPDAYSNC
KoreanCOUPDAYSNC
LithuanianCOUPDAYSNC
LatvianCOUPDAYSNC
NorwegianCOUPDAYSNC
DutchCOUP.DAGEN.VV
PolishWYPŁ.DNI.NAST
Portuguese (Brazil)COUPDAYSNC
Portuguese (Portugal)CUPDIASPRÓX
RomanianCOUPDAYSNC
RussianДНЕЙКУПОНПОСЛЕ
SlovakCOUPDAYSNC
SlovenianCOUPDAYSNC
Serbian (Latin)COUPDAYSNC
SwedishKUPDAGNK
ThaiCOUPDAYSNC
TurkishKUPONGÜNDSK işlevi
UkrainianCOUPDAYSNC
VietnameseCOUPDAYSNC
Chinese (Simplified)COUPDAYSNC
Chinese (Hong Kong)COUPDAYSNC
Chinese (Traditional)COUPDAYSNC

Names from Microsoft's support site.

What it does

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

COUPDAYSNC(settlement, maturity, frequency, [basis]) returns the number of days from the settlement date to the next coupon date.

It measures the forward span while COUPDAYBS measures the accrued backward span. Bond pricing uses a related remaining fraction, but its internal numerator cannot always be replaced by the published COUPDAYSNC answer. The retained discrepancy below explains why COUPDAYSNC / COUPDAYS is not an unconditional PRICE discount recipe.

The next coupon date is what COUPNCD returns, derived from the schedule described on COUPNCD.

basisHow COUPDAYSNC counts
0 — US (NASD) 30/36030/360-adjusted day count
1 — Actual/actualactual calendar days
2 — Actual/360actual calendar days
3 — Actual/365actual calendar days
4 — European 30/36030/360-adjusted day count

Microsoft's page documents the basis names, not this mapping; the table is the reference engine's.

Arguments

COUPDAYSNC(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 five-row basis table is documented on this page in the standard form — 0 or omitted = US (NASD) 30/360, 1 = actual/actual, 2 = actual/360, 3 = actual/365, 4 = European 30/360 — and Microsoft documents that "All arguments are truncated to integers."

There is no issue date and no first-coupon date: like every member of this family, the function knows only maturity and frequency, so an odd first period is invisible to it. Odd-period instruments need ODDFPRICE and ODDFYIELD, which take the extra dates.

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

The function Excel disagrees with itself about

COUPDAYSNC is the one member of this family where the Handbook's research record contains a concrete, published case of Excel returning two different answers to the same question in the same workbook.

The quantity "days from settlement to the next coupon" can be obtained two ways:

  1. Directly — count the days from settlement to COUPNCD, on the basis. This is what COUPDAYSNC does, except that on basis 0 its answers follow P − A (FN-COUPDAYSNC-001).
  2. By subtraction — take the period length and remove the days already accrued: COUPDAYS − COUPDAYBS.

On basis 4 and on actual/actual these agree, because COUPDAYS there is either the same 30/360 arithmetic or the real calendar length. On basis 0 they do not always agree: COUPDAYS is always 360/frequency where P need not be, so COUPDAYSNC(39923,50919,4,0) is 39 where 90 − 50 would give 40 (FN-COUPDAYSNC-001). On actual/360 and actual/365 they do not, because COUPDAYS reports a declared 360/frequency or 365/frequency while COUPDAYBS counts real days. The subtraction then yields a number that no calendar produces.

The Handbook's research record (EV-FIN-0029) documents Excel's PRICE taking route 2 — deriving days-to-next-coupon from the period length and the accrued days for every basis — while Excel's COUPDAYSNC, on the same bond and the same arguments, publishes route 1. The two numbers differ by whole days at bases 2 and 3, and the resulting prices differ in the first decimal place, not in the last bit. Both of Excel's answers are deterministic and reproducible; they are simply different functions of the same inputs.

For a reader the operative consequence is: COUPDAYSNC is not a safe substitute for whatever PRICE is using internally. If you are reconciling a price, reconcile against the price, not against this function's day count.

The general form of this fault line — that COUPDAYBS + COUPDAYSNC ≠ COUPDAYS on bases 2 and 3 — is set out on COUPDAYS.

Result and edge cases

Returns a Number: a day count, integral on every basis, and strictly positive.

  • settlement one day before maturity returns 1 on the actual bases, since maturity is always a coupon date.
  • On bases 2 and 3 the answer can exceed COUPDAYS — a "days remaining" larger than the reported period length. That is not a bug in this function; it is the additivity failure seen from this side.
  • The 30/360 bases can return a number that no calendar interval matches, by construction.
  • 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 dateerror
frequency is any number other than 1, 2 or 4error
basis < 0 or basis > 4error
settlement ≥ maturityerror

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.

FormulaExcelMathematical value
COUPDAYSNC(39923, 50919, 4, 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: 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 file
Inputs 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 file
Inputs 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 file
Inputs 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 file
Inputs 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 file
Inputs and reference value

Number supplied through a cell.

settlement: 61
0x404e800000000000

maturity: 456
0x407c800000000000

frequency: 1
0x3ff0000000000000

basis: 0
0x0000000000000000

29
0x403d000000000000
—

Inputs, build details and evidence

How to implement

Numerical notes

  1. Integer arithmetic throughout. Every answer is a whole number of days; compute it in integers and convert once.
  2. Never derive it by subtraction. The whole content of the section above is that the derived and the direct forms are different functions. An implementation that computes COUPDAYS − COUPDAYBS will match Excel's PRICE and contradict Excel's COUPDAYSNC, or the reverse — it cannot do both.
  3. Share one 30/360 routine, and pin the order of its two adjustments; see COUPDAYBS.
  4. The roll-forward branch dominates the boundary behaviour and should be decided and documented before any counting code is written.
  5. There is no rounding, cancellation or transcendental content in this function. Its difficulty is definitional and, unusually for this Handbook, it is a difficulty Excel itself demonstrably has.

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.

COUPDAYSNC · 4 lines · calc-func/src/catalogue/bonds.rs on GitHub
12 coupdaysnc_fn "COUPDAYSNC" (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::coupdaysnc_kernel(settlement, maturity, frequency, b))
}
coupdaysnc_kernel · 23 lines · calc-func/src/ported/coupon_family.rs on GitHub
pub fn coupdaysnc_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)?;
    if ctx.basis == CouponBasis::Us30_360 {
        // The whole period normalizes both actual coupon endpoints: day 31 and Gregorian
        // February ends become day 30. It need not equal COUPDAYS' 360/frequency when a
        // non-month-end maturity's day was clamped in February. Subtract the distinct US
        // accrual count, whose end adjustment depends on its original start day.
        // Fn7 paired date/accrual/remaining-day controls cover calendar zero, fictitious
        // February 29 and independent month-end schedules; all readings are retained.
        let coupon_days = calendar_days360(
            period.previous, period.next, CalendarDayAdjustment::CouponPeriod,
        )?;
        let accrued = accrued_or_remaining_days(period.previous, ctx.settlement, ctx.basis)?;
        return Ok(coupon_days - accrued);
    }
    accrued_or_remaining_days(ctx.settlement, period.next, ctx.basis)
}

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

COUPDAYSNC(39923, 50919, 4, 0) returned 39 (0x4043800000000000). COUPDAYSNC(45986, 57038, 2, 0) returned 95 (0x4057c00000000000). 3 further recorded controls are 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
  • COUPDAYSNC(39923, 50919, 4, 0) → 39
    0x4043800000000000 (cell-value2)
  • COUPDAYSNC(45986, 57038, 2, 0) → 95
    0x4057c00000000000 (cell-value2)
  • COUPDAYSNC(46478, 46627, 4, 0) → 57
    0x404c800000000000 (cell-value2)
  • COUPDAYSNC(33, 400, 2, 0) → 1
    0x3ff0000000000000 (cell-value2)
  • COUPDAYSNC(61, 456, 1, 0) → 29
    0x403d000000000000 (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

  • COUPDAYBS — the backward complement. The pair partitions the period only on bases 1 and 4, and not always on basis 0 (FN-COUPDAYSNC-001).
  • COUPDAYS — the denominator, and the source of the mismatch described above.
  • COUPNCD — the date this function counts to. COUPNCD − settlement is the actual remaining days, equal to COUPDAYSNC on bases 1, 2 and 3 only.
  • PRICE, YIELD, DURATION, MDURATION — the consumers, and, per the research record, not necessarily consumers of this function's answer.
  • ODDFPRICE, ODDFYIELD — the odd-first-period instruments, which need the extra dates this family does not take.
  • Confused with: COUPDAYS − COUPDAYBS, which is a different quantity on bases 2 and 3, and on basis 0 in the cases of FN-COUPDAYSNC-001, and is the one Excel's PRICE was observed to use.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents