{
  "category": "Financial functions",
  "display_name": "COUPDAYSNC",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.COUPDAYSNC",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20131",
        "20430",
        "?"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 5584,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 5584,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 5,584 in the answer bank and 7 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 5,591 recorded answers",
    "workbook_corpus": {
      "cells": 7,
      "matched": 7
    }
  },
  "implementations": [
    {
      "commit": "9e1884369a678158dd82d3d74188daf986995e87",
      "flavour": "excel-compatibility-candidate",
      "language": "Rust",
      "name": "CalcFunc",
      "own_code": [
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/bonds.rs#L175-L178",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/ported/coupon_family.rs#L323-L345"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/bonds::basis",
        "catalogue/bonds::coupon_out",
        "catalogue/bonds::coupon_args",
        "catalogue/financial::date_1900",
        "locale::days_from_civil",
        "locale::civil_from_days",
        "locale::excel_serial_from_ymd",
        "locale::ymd_from_excel_serial",
        "ported/coupon_family::max_excel_serial",
        "ported/coupon_family::days_in_month",
        "ported/coupon_family::days_from_civil",
        "ported/coupon_family::excel_serial_from_ymd_unbounded_1900",
        "ported/coupon_family::calendar_days360",
        "ported/coupon_family::actual_days",
        "ported/coupon_family::accrued_or_remaining_days",
        "ported/coupon_family::parse_basis",
        "ported/coupon_family::parse_frequency",
        "ported/coupon_family::check_coupon_dates",
        "ported/coupon_family::parse_coupon_date",
        "ported/coupon_family::parse_coupon_context",
        "ported/coupon_family::coupon_date_before_maturity",
        "ported/coupon_family::locate_coupon_period"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/bonds.rs#L175-L178",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 5,591 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.COUPDAYSNC.json",
  "name": "COUPDAYSNC",
  "notes": [
    {
      "basis": "1,664 recorded rows with a number answer on basis 0, from builds 20131, 20430 and 20527, recomputed independently from the calendar. An implementation of these rules matches all 33,504 selected readings of the six coupon functions. Fictitious 1900-02-29 is not a month end here.",
      "documentation": null,
      "evidence": [
        {
          "commit": "7ec08d6707059ef1d74922ac9b8e0769f6093312",
          "locator": "coupdaysnc_kernel",
          "note": "the rule as implemented",
          "path": "crates/calc-func/src/ported/coupon_family.rs",
          "repository": "DnaCalc"
        },
        {
          "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
          "locator": null,
          "note": "733 recorded readings",
          "path": "crates/calc-func/tests/captures/fn4_questions/COUPDAYSNC.reading.json",
          "repository": "DnaCalc"
        },
        {
          "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
          "locator": null,
          "note": "120 recorded readings",
          "path": "crates/calc-func/tests/captures/fn4_questions/COUPDAYBS.reading.json",
          "repository": "DnaCalc"
        },
        {
          "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
          "locator": "dc-zmk.4",
          "note": "the 33,504 selected coupon readings",
          "path": ".beads/issues.jsonl",
          "repository": "DnaCalc"
        }
      ],
      "functions": [
        "FUNC.COUPDAYBS",
        "FUNC.COUPDAYS",
        "FUNC.COUPDAYSNC"
      ],
      "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.",
      "kind": "quirk",
      "note_id": "FN-COUPDAYSNC-001",
      "open": [],
      "recorded_on": "2026-11-04",
      "repros": [
        {
          "call": "COUPDAYSNC(39923, 50919, 4, 0)",
          "correct": null,
          "excel": {
            "bits": "0x4043800000000000",
            "display": "39",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e37e6000000000",
                "display": "39923",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e8dce000000000",
                "display": "50919",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4010000000000000",
                "display": "4",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "fn7-COUPDAYSNC-remaining-calendar-1",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/COUPDAYSNC.reading.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "COUPDAYSNC(45986, 57038, 2, 0)",
          "correct": null,
          "excel": {
            "bits": "0x4057c00000000000",
            "display": "95",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e6744000000000",
                "display": "45986",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40ebd9c000000000",
                "display": "57038",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "fn7-COUPDAYSNC-remaining-calendar-2",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/COUPDAYSNC.reading.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "COUPDAYSNC(46478, 46627, 4, 0)",
          "correct": null,
          "excel": {
            "bits": "0x404c800000000000",
            "display": "57",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e6b1c000000000",
                "display": "46478",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e6c46000000000",
                "display": "46627",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4010000000000000",
                "display": "4",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "fn7-COUPDAYSNC-full-period-holdout-90",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/COUPDAYSNC.reading.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "COUPDAYSNC(33, 400, 2, 0)",
          "correct": null,
          "excel": {
            "bits": "0x3ff0000000000000",
            "display": "1",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x4040800000000000",
                "display": "33",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x4079000000000000",
                "display": "400",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "fn7-COUPDAYSNC-calendar-boundary-127",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/COUPDAYSNC.reading.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "COUPDAYBS(61, 456, 1, 0)",
          "correct": null,
          "excel": {
            "bits": "0x404e800000000000",
            "display": "61",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x404e800000000000",
                "display": "61",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x407c800000000000",
                "display": "456",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "fn7-COUPDAYBS-fake-february-43",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/COUPDAYBS.reading.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "COUPDAYSNC(61, 456, 1, 0)",
          "correct": null,
          "excel": {
            "bits": "0x403d000000000000",
            "display": "29",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x404e800000000000",
                "display": "61",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x407c800000000000",
                "display": "456",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "fn7-COUPDAYSNC-fake-february-43",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/COUPDAYSNC.reading.json",
            "repository": "DnaCalc"
          }
        }
      ],
      "schema": "efh.function-note/v1",
      "statement": "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.",
      "status": "measured",
      "title": "On basis 0 COUPDAYSNC is not always COUPDAYS minus COUPDAYBS"
    }
  ],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n### Relationships\n\n\n- **[COUPDAYBS](FUNC.COUPDAYBS.md)** — the backward complement. The pair partitions the period\n  only on bases 1 and 4, and not always on basis 0 (FN-COUPDAYSNC-001).\n- **[COUPDAYS](FUNC.COUPDAYS.md)** — the denominator, and the source of the mismatch described\n  above.\n- **[COUPNCD](FUNC.COUPNCD.md)** — the date this function counts to. `COUPNCD − settlement` is\n  the *actual* remaining days, equal to `COUPDAYSNC` on bases 1, 2 and 3 only.\n- **`PRICE`, `YIELD`, `DURATION`, `MDURATION`** — the consumers, and, per the research record,\n  not necessarily consumers of *this* function's answer.\n- **`ODDFPRICE`, `ODDFYIELD`** — the odd-first-period instruments, which need the extra dates\n  this family does not take.\n- **Confused with**: `COUPDAYS − COUPDAYBS`, which is a different quantity on bases 2 and 3, and\n  on basis 0 in the cases of FN-COUPDAYSNC-001, and is the one Excel's `PRICE` was observed to use.\n\n\n",
    "how-to-implement": "\n### Numerical notes\n\n\n1. **Integer arithmetic throughout.** Every answer is a whole number of days; compute it in\n   integers and convert once.\n2. **Never derive it by subtraction.** The whole content of the section above is that the\n   derived and the direct forms are different functions. An implementation that computes\n   `COUPDAYS − COUPDAYBS` will match Excel's `PRICE` and contradict Excel's `COUPDAYSNC`, or the\n   reverse — it cannot do both.\n3. **Share one 30/360 routine**, and pin the order of its two adjustments; see\n   [COUPDAYBS](FUNC.COUPDAYBS.md#numerical-notes).\n4. **The roll-forward branch dominates the boundary behaviour** and should be decided and\n   documented before any counting code is written.\n5. There is no rounding, cancellation or transcendental content in this function. Its\n   difficulty is definitional and, unusually for this Handbook, it is a difficulty Excel itself\n   demonstrably has.\n\n\n",
    "quirks": "\n### The function Excel disagrees with itself about\n\n\n`COUPDAYSNC` is the one member of this family where the Handbook's research record contains a\nconcrete, published case of **Excel returning two different answers to the same question in the\nsame workbook**.\n\nThe quantity \"days from settlement to the next coupon\" can be obtained two ways:\n\n1. **Directly** — count the days from `settlement` to `COUPNCD`, on the `basis`. This is what\n   `COUPDAYSNC` does, except that on basis 0 its answers follow `P − A` (FN-COUPDAYSNC-001).\n2. **By subtraction** — take the period length and remove the days already accrued:\n   `COUPDAYS − COUPDAYBS`.\n\nOn basis 4 and on actual/actual these agree, because `COUPDAYS` there is either the same 30/360\narithmetic or the real calendar length. On basis 0 they do not always agree: `COUPDAYS` is always\n`360/frequency` where `P` need not be, so `COUPDAYSNC(39923,50919,4,0)` is 39 where `90 − 50` would\ngive 40 (FN-COUPDAYSNC-001). On **actual/360 and actual/365** they do\nnot, because `COUPDAYS` reports a declared `360/frequency` or `365/frequency` while `COUPDAYBS`\ncounts real days. The subtraction then yields a number that no calendar produces.\n\nThe Handbook's research record (`EV-FIN-0029`) documents Excel's `PRICE` taking route 2 — deriving\ndays-to-next-coupon from the period length and the accrued days for every basis — while Excel's\n`COUPDAYSNC`, on the same bond and the same arguments, publishes route 1. The two numbers differ\nby whole days at bases 2 and 3, and the resulting prices differ in the first decimal place, not\nin the last bit. Both of Excel's answers are deterministic and reproducible; they are simply\ndifferent functions of the same inputs.\n\nFor a reader the operative consequence is: **`COUPDAYSNC` is not a safe substitute for whatever\n`PRICE` is using internally.** If you are reconciling a price, reconcile against the price, not\nagainst this function's day count.\n\nThe general form of this fault line — that `COUPDAYBS + COUPDAYSNC ≠ COUPDAYS` on bases 2 and\n3 — is set out on [COUPDAYS](FUNC.COUPDAYS.md#the-additivity-that-fails).\n\n\n\n### Result and edge cases\n\n\nReturns a `Number`: a day count, integral on every basis, and strictly positive.\n\n- **`settlement` one day before maturity** returns 1 on the actual bases, since `maturity` is\n  always a coupon date.\n- **On bases 2 and 3 the answer can exceed `COUPDAYS`** — a \"days remaining\" larger than the\n  reported period length. That is not a bug in this function; it is the additivity failure seen\n  from this side.\n- **The 30/360 bases** can return a number that no calendar interval matches, by construction.\n- **`settlement` ≥ `maturity`** is a documented error.\n- Empty, missing and error arguments follow the shared call model; see\n  [The value universe](../model/01-value-universe.md).\n\n\n\n### Errors\n\n\nDocumented on Microsoft's Learn page for this function, in these words (it says \"generates an\nerror\" without naming a worksheet error value):\n\n| Condition (documented) | Documented outcome |\n|---|---|\n| `settlement` or `maturity` is not a valid date | error |\n| `frequency` is any number other than 1, 2 or 4 | error |\n| `basis` < 0 or `basis` > 4 | error |\n| `settlement` ≥ `maturity` | error |\n\n",
    "sources": "- Microsoft Learn, **WorksheetFunction.CoupDaysNc method (Excel)** —\n  <https://learn.microsoft.com/en-us/office/vba/api/excel.worksheetfunction.coupdaysnc>. Source\n  of the one-line description, the parameter table, the five-row basis table, the \"All arguments\n  are truncated to integers\" rule, the date-entry warning, and the four error conditions.\n- Microsoft 365 support, **COUPDAYSNC function** —\n  <https://support.microsoft.com/en-us/office/coupdaysnc-function-5ab3f0b2-029f-4a8b-bb65-47d525eea547>.\n  The worksheet-surface page; **not retrieved** for this entry (the host returned HTTP 403), so\n  nothing here is quoted from it.\n- Handbook, `content/lastbit/MATERIAL_W109_PRIMITIVES.md` §18 — the recorded case of Excel's\n  `PRICE` deriving days-to-next-coupon by subtraction and disagreeing with this function on the\n  actual/360 and actual/365 bases.\n- Handbook, [COUPNCD](FUNC.COUPNCD.md#the-coupon-schedule) and\n  [COUPDAYS](FUNC.COUPDAYS.md#the-additivity-that-fails).\n- Handbook evidence records `EV-FIN-0029` and `EV-FIN-0030` — what the `COUP*` figures are, and\n  are not.\n- Handbook chapters [01 the value universe](../model/01-value-universe.md),\n  [02 coercion and lifting](../model/02-coercion-and-lifting.md),\n  [06 claim language](../model/06-claim-language.md).\n- `data/functions/FUNC.COUPDAYSNC.json`, `data/presence/FUNC.COUPDAYSNC.json`,\n  `data/battery/FUNC.COUPDAYSNC.json`.\n\n",
    "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.\n\n| Excel 16.0 build | Platform and CPU | Captured inputs |\n|---|---|---:|\n| 20131 | Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics | 1,060 |\n| 20430 | Windows, 64-bit, AMD Ryzen 7 4800H with Radeon Graphics | 3,012 |\n\nThe 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.\n\n[Recorded environments and comparison details](https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.COUPDAYSNC.json).",
    "what-it-does": "\n`COUPDAYSNC(settlement, maturity, frequency, [basis])` returns **the number of days from the\nsettlement date to the next coupon date**.\n\nIt measures the forward span while [COUPDAYBS](FUNC.COUPDAYBS.md) measures the accrued\nbackward span. Bond pricing uses a related remaining fraction, but its internal numerator\ncannot always be replaced by the published `COUPDAYSNC` answer. The retained discrepancy\nbelow explains why `COUPDAYSNC / COUPDAYS` is not an unconditional PRICE discount recipe.\n\nThe next coupon date is what [COUPNCD](FUNC.COUPNCD.md) returns, derived from the schedule\ndescribed on [COUPNCD](FUNC.COUPNCD.md#the-coupon-schedule).\n\n| `basis` | How `COUPDAYSNC` counts |\n|---|---|\n| 0 — US (NASD) 30/360 | 30/360-adjusted day count |\n| 1 — Actual/actual | actual calendar days |\n| 2 — Actual/360 | actual calendar days |\n| 3 — Actual/365 | actual calendar days |\n| 4 — European 30/360 | 30/360-adjusted day count |\n\nMicrosoft's page documents the basis names, not this mapping; the table is the reference\nengine's.\n\n\n\n### Arguments\n\n\n`COUPDAYSNC(settlement, maturity, frequency, [basis])` — the family's shared four arguments,\nwith Microsoft's wording quoted on [COUPDAYBS](FUNC.COUPDAYBS.md#arguments).\n\n| Argument | Meaning | Required? |\n|---|---|---|\n| `settlement` | The security's settlement date. | Required |\n| `maturity` | The security's maturity date. | Required |\n| `frequency` | Coupon payments per year: 1, 2 or 4. | Required |\n| `basis` | The day-count basis, 0–4. | Optional, defaults to 0 |\n\nThe five-row basis table is documented on this page in the standard form — 0 or omitted = US\n(NASD) 30/360, 1 = actual/actual, 2 = actual/360, 3 = actual/365, 4 = European 30/360 — and\nMicrosoft documents that **\"All arguments are truncated to integers.\"**\n\nThere is no issue date and no first-coupon date: like every member of this family, the function\nknows only `maturity` and `frequency`, so an odd first period is invisible to it. Odd-period\ninstruments need `ODDFPRICE` and `ODDFYIELD`, which take the extra dates.\n\n\n"
  },
  "signature": {
    "display": "COUPDAYSNC(settlement, maturity, frequency, [basis])",
    "parameters": [
      {
        "description": null,
        "name": "settlement",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "maturity",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "frequency",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "basis",
        "optional": true,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 4,
        "min": 3
      },
      "category": "Financial functions",
      "classification": {
        "arg_preparation_profile": "ValuesOnlyPreAdapter",
        "coercion_lift_profile": "Custom",
        "determinism_class": "Deterministic",
        "error_collapse_profile": "None",
        "fec_dependency_profile": "None",
        "host_interaction_class": "None",
        "kernel_signature_class": "Custom",
        "rich_value_usage": "RichBlind",
        "surface_fec_dependency_profile": "RefOnly",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Days left from settlement until the coupon date that follows it",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the number of days from the settlement date to the next coupon date",
        "microsoft_url": "https://support.microsoft.com/en-us/office/coupdaysnc-function-5ab3f0b2-029f-4a8b-bb65-47d525eea547"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "bg-BG",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "cs-CZ",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "da-DK",
          "name": "KUPONDAGE.ANK"
        },
        {
          "locale": "de-DE",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "el-GR",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "en-AU",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "en-GB",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "en-US",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "es-ES",
          "name": "CUPON.DIAS.L2"
        },
        {
          "locale": "et-EE",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "fi-FI",
          "name": "KORKOPÄIVÄT.SEURAAVA"
        },
        {
          "locale": "fr-FR",
          "name": "NB.JOURS.COUPON.SUIV*"
        },
        {
          "locale": "he-IL",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "hr-HR",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "hu-HU",
          "name": "SZELVÉNYIDŐ.KIFIZETÉSTŐL"
        },
        {
          "locale": "id-ID",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "it-IT",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "ja-JP",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "ko-KR",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "lt-LT",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "lv-LV",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "nb-NO",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "nl-NL",
          "name": "COUP.DAGEN.VV"
        },
        {
          "locale": "pl-PL",
          "name": "WYPŁ.DNI.NAST"
        },
        {
          "locale": "pt-BR",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "pt-PT",
          "name": "CUPDIASPRÓX"
        },
        {
          "locale": "ro-RO",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "ru-RU",
          "name": "ДНЕЙКУПОНПОСЛЕ"
        },
        {
          "locale": "sk-SK",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "sl-SI",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "sv-SE",
          "name": "KUPDAGNK"
        },
        {
          "locale": "th-TH",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "tr-TR",
          "name": "KUPONGÜNDSK işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "vi-VN",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "zh-CN",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "zh-HK",
          "name": "COUPDAYSNC"
        },
        {
          "locale": "zh-TW",
          "name": "COUPDAYSNC"
        }
      ],
      "signature": {
        "display": "COUPDAYSNC(settlement, maturity, frequency, [basis])",
        "parameters": [
          {
            "description": null,
            "name": "settlement",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "maturity",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "frequency",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "basis",
            "optional": true,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "COUPDAYSNC",
      "version_marker": null,
      "xlcall": {
        "code": "454",
        "symbol": "xlfCoupdaysnc"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/coupdaysnc-function-5ab3f0b2-029f-4a8b-bb65-47d525eea547"
  },
  "try_it": {
    "formula": "=COUPDAYSNC(39923,50919,4,0)"
  },
  "url": "https://handbook.dnacalc.com/functions/COUPDAYSNC.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "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.",
      "excel_build": "16.0.20527.20088",
      "observations": [
        {
          "call": "COUPDAYSNC(39923, 50919, 4, 0)",
          "excel": {
            "bits": "0x4043800000000000",
            "display": "39",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e37e6000000000",
                "display": "39923",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e8dce000000000",
                "display": "50919",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4010000000000000",
                "display": "4",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file"
        },
        {
          "call": "COUPDAYSNC(45986, 57038, 2, 0)",
          "excel": {
            "bits": "0x4057c00000000000",
            "display": "95",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e6744000000000",
                "display": "45986",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40ebd9c000000000",
                "display": "57038",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file"
        },
        {
          "call": "COUPDAYSNC(46478, 46627, 4, 0)",
          "excel": {
            "bits": "0x404c800000000000",
            "display": "57",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e6b1c000000000",
                "display": "46478",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e6c46000000000",
                "display": "46627",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4010000000000000",
                "display": "4",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file"
        },
        {
          "call": "COUPDAYSNC(33, 400, 2, 0)",
          "excel": {
            "bits": "0x3ff0000000000000",
            "display": "1",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x4040800000000000",
                "display": "33",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x4079000000000000",
                "display": "400",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file"
        },
        {
          "call": "COUPDAYSNC(61, 456, 1, 0)",
          "excel": {
            "bits": "0x403d000000000000",
            "display": "29",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x404e800000000000",
                "display": "61",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x407c800000000000",
                "display": "456",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088, Windows, bitness and CPU not recorded in this reading file"
        }
      ],
      "platform": "Windows, bitness and CPU not recorded in this reading file",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/3345a87/content/notes/FN-COUPDAYSNC-001.json"
      ]
    },
    {
      "behaviour": "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_build": "16.0 build 20131",
      "platform": "Windows, bitness not recorded, AMD Ryzen 7 4800H with Radeon Graphics",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.COUPDAYSNC.json"
      ]
    },
    {
      "behaviour": "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.",
      "excel_build": "16.0 build 20430",
      "platform": "Windows, 64-bit, AMD Ryzen 7 4800H with Radeon Graphics",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/5dc75391aa5125ccc5abdb095da85950980d6fd8/content/evidence/environments/FUNC.COUPDAYSNC.json"
      ]
    }
  ]
}