{
  "category": "Financial functions",
  "display_name": "COUPNUM",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.COUPNUM",
  "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 13 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 5,597 recorded answers",
    "workbook_corpus": {
      "cells": 13,
      "matched": 13
    }
  },
  "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#L183-L186",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/ported/coupon_family.rs#L358-L372"
      ],
      "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::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#L183-L186",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 5,597 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.COUPNUM.json",
  "name": "COUPNUM",
  "notes": [
    {
      "basis": "The rule matches all 429 recorded COUPNUM readings (325 #NUM!, 104 counts) when recomputed independently from the calendar, and the 24 COUPNUM readings of the date-boundary sheets. COUPPCD, COUPNCD, COUPDAYS, COUPDAYBS and COUPDAYSNC companions come from the same sheets.",
      "documentation": null,
      "evidence": [
        {
          "commit": "2033d9feb7d9f99817b4b2b34837509bf5af843c",
          "locator": "coupnum_kernel",
          "note": "the limit as implemented",
          "path": "crates/calc-func/src/ported/coupon_family.rs",
          "repository": "DnaCalc"
        },
        {
          "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
          "locator": "delivered_fn4_coupon_counts_at_calendar_start",
          "note": "recorded answers pinned",
          "path": "apps/dna-onecalc/tests/acceptance.rs",
          "repository": "DnaCalc"
        },
        {
          "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
          "locator": null,
          "note": "429 recorded readings",
          "path": "crates/calc-func/tests/captures/fn4_questions/COUPNUM.reading.json",
          "repository": "DnaCalc"
        },
        {
          "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
          "locator": "sheets qd153 to qd236",
          "note": "boundary sheets for all six coupon functions",
          "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-date-domain.capture.json",
          "repository": "DnaCalc"
        }
      ],
      "functions": [
        "FUNC.COUPNCD",
        "FUNC.COUPNUM",
        "FUNC.COUPPCD"
      ],
      "inferred": null,
      "kind": "quirk",
      "note_id": "FN-COUPNUM-001",
      "open": [],
      "recorded_on": "2026-11-04",
      "repros": [
        {
          "call": "COUPNUM(33, 400, 2, 0)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#NUM!",
            "kind": "error"
          },
          "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-COUPNUM-calendar-boundary-127",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/COUPNUM.reading.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "COUPNUM(34, 400, 2, 0)",
          "correct": null,
          "excel": {
            "bits": "0x4000000000000000",
            "display": "2",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x4041000000000000",
                "display": "34",
                "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-COUPNUM-calendar-boundary-128",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/COUPNUM.reading.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "COUPNUM(0, 367, 2, 0)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#NUM!",
            "kind": "error"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x4076f00000000000",
                "display": "367",
                "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-COUPNUM-calendar-boundary-85",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/COUPNUM.reading.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=COUPNUM(0,182,2,0)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#NUM!",
            "kind": "error"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet qd230, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-date-domain.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=COUPNUM(A1,400,2,0)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#NUM!",
            "kind": "error"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "A1",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet qd205, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-date-domain.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=COUPPCD(A1,400,2,0)",
          "correct": null,
          "excel": {
            "bits": "0x0000000000000000",
            "display": "0",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "A1",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet qd217, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-date-domain.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=COUPNCD(A1,400,2,0)",
          "correct": null,
          "excel": {
            "bits": "0x4041000000000000",
            "display": "34",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "A1",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
          "source": {
            "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
            "locator": "sheet qd193, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-date-domain.capture.json",
            "repository": "DnaCalc"
          }
        }
      ],
      "schema": "efh.function-note/v1",
      "statement": "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.",
      "status": "measured",
      "title": "COUPNUM is #NUM! when the coupon before settlement falls before 1900"
    }
  ],
  "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- **[COUPNCD](FUNC.COUPNCD.md)** — the date of the first of the counted coupons, and the page\n  that hosts the shared schedule description.\n- **[COUPPCD](FUNC.COUPPCD.md)** — the date of the coupon *not* counted, immediately before\n  `settlement`.\n- **[COUPDAYS](FUNC.COUPDAYS.md)**, **[COUPDAYBS](FUNC.COUPDAYBS.md)**,\n  **[COUPDAYSNC](FUNC.COUPDAYSNC.md)** — the day counts within the first of the remaining\n  periods. `COUPNUM` counts whole periods; those three subdivide the current one.\n- **`PRICE`, `YIELD`, `DURATION`, `MDURATION`** — the consumers. Each evaluates a sum with\n  `COUPNUM` terms, discounted at exponents built from `COUPDAYSNC / COUPDAYS` plus whole\n  periods.\n- **`NPER`** — the annuity-count function, which answers a superficially similar question\n  (how many periods) from rates and payments rather than from dates. The two are not\n  substitutes.\n- **Confused with**: `(maturity − settlement) / 365 × frequency` rounded up, which agrees with\n  `COUPNUM` most of the time and disagrees exactly where the schedule's month arithmetic\n  matters.\n\n\n",
    "how-to-implement": "\n### Numerical notes\n\n1. **The answer is an integer and should be computed as one.** Deriving it from a year fraction\n   and rounding is the classic way to introduce an off-by-one at period boundaries: a\n   floating-point year fraction that lands a hair below an integer rounds the wrong way.\n3. **The roll-forward branch changes the answer by a whole unit**, and the limit at 1900 in\n   FN-COUPNUM-001 is a second boundary. The branch is decided before any counting, and it is shared\n   with the rest of the family — one probe fixes all six functions.\n4. **Cost is linear in the answer.** For a synthetic instrument maturing centuries out, an\n   iterating implementation does real work; a consumer computing `COUPNUM` inside a solver loop\n   will feel it.\n5. **Validate `basis` and ignore it.** There is nothing for a day-count routine to do here.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns a `Number`: a positive integer, or `#NUM!` when the coupon before settlement falls before\n1900 (FN-COUPNUM-001).\n\n- **`settlement` one day before maturity** returns 1: the maturity coupon.\n- **The answer is independent of `basis`** on every input where it is defined.\n- **`settlement` ≥ `maturity`** is a documented error, which is why the answer is never 0.\n- **Month-end maturities** change *which* dates the coupons fall on but not how many there are,\n  except at the boundary where a shifted date crosses `settlement`.\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.CoupNum method (Excel)** —\n  <https://learn.microsoft.com/en-us/office/vba/api/excel.worksheetfunction.coupnum>. Source of\n  the description including the \"rounded up to the nearest whole coupon\" clause, the parameter\n  table, the five-row basis table, the \"All arguments are truncated to integers\" rule, the\n  date-entry warning, and the four error conditions.\n- Microsoft 365 support, **COUPNUM function** —\n  <https://support.microsoft.com/en-us/office/coupnum-function-a90af57b-de53-4969-9c99-dd6139db2522>.\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, [COUPNCD](FUNC.COUPNCD.md#the-coupon-schedule) — the shared schedule construction.\n- Handbook evidence record `EV-FIN-0030` — what the six `COUP*` figures are, and 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.COUPNUM.json`, `data/presence/FUNC.COUPNUM.json`,\n  `data/battery/FUNC.COUPNUM.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.COUPNUM.json).",
    "what-it-does": "\n`COUPNUM(settlement, maturity, frequency, [basis])` returns **the number of coupons payable\nbetween the settlement date and the maturity date**. Microsoft's Learn page adds the decisive\nclause: \"**rounded up to the nearest whole coupon**\".\n\nThat clause is the whole definition. A bond settled part-way through a coupon period still has\nthat period's coupon ahead of it, so a partial period counts as a whole one. Equivalently, on\nthe schedule described on [COUPNCD](FUNC.COUPNCD.md#the-coupon-schedule) — coupon dates counted\nbackwards from `maturity` in `12/frequency`-month steps — `COUPNUM` is the number of schedule\ndates strictly after `settlement`, up to and including `maturity`.\n\nWhen it returns a number, that number is a positive integer, and it is the number of terms in\nthe cash-flow sums that `PRICE`, `YIELD`, `DURATION` and `MDURATION` evaluate. An off-by-one here is\nan off-by-one coupon in every one of them.\n\nThe relationship to the rest of the family:\n\n>     COUPNUM = 1 + (whole coupon periods between COUPNCD and maturity)\n\nso the first of the counted coupons falls on [COUPNCD](FUNC.COUPNCD.md) and the last on\n`maturity`.\n\n\n\n### Arguments\n\n\n`COUPNUM(settlement, maturity, frequency, [basis])` — the family's shared four arguments, with\nMicrosoft'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 standard five-row basis table is documented on this page — 0 or omitted = US (NASD) 30/360,\n1 = actual/actual, 2 = actual/360, 3 = actual/365, 4 = European 30/360.\n\n**`basis` cannot change the answer.** Counting coupon dates is calendar arithmetic; no\nday-count convention adds or removes a date from the schedule. `basis` is nevertheless validated\nand an out-of-range value turns a well-defined count into an error — the same\nnon-participating-but-fatal argument that appears on [COUPNCD](FUNC.COUPNCD.md) and\n[COUPPCD](FUNC.COUPPCD.md).\n\nMicrosoft documents that **\"All arguments are truncated to integers.\"**\n\n\n"
  },
  "signature": {
    "display": "COUPNUM(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": "Number of coupons still to be paid between settlement and maturity",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the number of coupons payable between the settlement date and maturity date",
        "microsoft_url": "https://support.microsoft.com/en-us/office/coupnum-function-a90af57b-de53-4969-9c99-dd6139db2522"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "COUPNUM"
        },
        {
          "locale": "bg-BG",
          "name": "COUPNUM"
        },
        {
          "locale": "cs-CZ",
          "name": "COUPNUM"
        },
        {
          "locale": "da-DK",
          "name": "KUPONBETALINGER"
        },
        {
          "locale": "de-DE",
          "name": "COUPNUM"
        },
        {
          "locale": "el-GR",
          "name": "COUPNUM"
        },
        {
          "locale": "en-AU",
          "name": "COUPNUM"
        },
        {
          "locale": "en-GB",
          "name": "COUPNUM"
        },
        {
          "locale": "en-US",
          "name": "COUPNUM"
        },
        {
          "locale": "es-ES",
          "name": "CUPON.NUM"
        },
        {
          "locale": "et-EE",
          "name": "COUPNUM"
        },
        {
          "locale": "fi-FI",
          "name": "KORKOPÄIVÄ.JAKSOT"
        },
        {
          "locale": "fr-FR",
          "name": "NB.COUPONS*"
        },
        {
          "locale": "he-IL",
          "name": "COUPNUM"
        },
        {
          "locale": "hr-HR",
          "name": "COUPNUM"
        },
        {
          "locale": "hu-HU",
          "name": "SZELVÉNYSZÁM"
        },
        {
          "locale": "id-ID",
          "name": "COUPNUM"
        },
        {
          "locale": "it-IT",
          "name": "COUPNUM"
        },
        {
          "locale": "ja-JP",
          "name": "COUPNUM"
        },
        {
          "locale": "ko-KR",
          "name": "COUPNUM"
        },
        {
          "locale": "lt-LT",
          "name": "COUPNUM"
        },
        {
          "locale": "lv-LV",
          "name": "COUPNUM"
        },
        {
          "locale": "nb-NO",
          "name": "COUPNUM"
        },
        {
          "locale": "nl-NL",
          "name": "COUP.AANTAL"
        },
        {
          "locale": "pl-PL",
          "name": "WYPŁ.LICZBA"
        },
        {
          "locale": "pt-BR",
          "name": "COUPNUM"
        },
        {
          "locale": "pt-PT",
          "name": "CUPNÚM"
        },
        {
          "locale": "ro-RO",
          "name": "COUPNUM"
        },
        {
          "locale": "ru-RU",
          "name": "ЧИСЛКУПОН"
        },
        {
          "locale": "sk-SK",
          "name": "COUPNUM"
        },
        {
          "locale": "sl-SI",
          "name": "COUPNUM"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "COUPNUM"
        },
        {
          "locale": "sv-SE",
          "name": "KUPANT"
        },
        {
          "locale": "th-TH",
          "name": "COUPNUM"
        },
        {
          "locale": "tr-TR",
          "name": "KUPONSAYI işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "COUPNUM"
        },
        {
          "locale": "vi-VN",
          "name": "COUPNUM"
        },
        {
          "locale": "zh-CN",
          "name": "COUPNUM"
        },
        {
          "locale": "zh-HK",
          "name": "COUPNUM"
        },
        {
          "locale": "zh-TW",
          "name": "COUPNUM"
        }
      ],
      "signature": {
        "display": "COUPNUM(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": "COUPNUM",
      "version_marker": null,
      "xlcall": {
        "code": "456",
        "symbol": "xlfCoupnum"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/coupnum-function-a90af57b-de53-4969-9c99-dd6139db2522"
  },
  "try_it": {
    "formula": "=COUPNUM(34,400,2,0)"
  },
  "url": "https://handbook.dnacalc.com/functions/COUPNUM.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "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.",
      "excel_build": "16.0.20527.20088",
      "observations": [
        {
          "call": "COUPNUM(33, 400, 2, 0)",
          "excel": {
            "bits": null,
            "display": "#NUM!",
            "kind": "error"
          },
          "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": "COUPNUM(34, 400, 2, 0)",
          "excel": {
            "bits": "0x4000000000000000",
            "display": "2",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x4041000000000000",
                "display": "34",
                "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": "COUPNUM(0, 367, 2, 0)",
          "excel": {
            "bits": null,
            "display": "#NUM!",
            "kind": "error"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x4076f00000000000",
                "display": "367",
                "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"
        }
      ],
      "platform": "Windows, bitness and CPU not recorded in this reading file",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/3345a87/content/notes/FN-COUPNUM-001.json"
      ]
    },
    {
      "behaviour": "=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.",
      "excel_build": "16.0.20527.20088",
      "observations": [
        {
          "call": "=COUPNUM(0,182,2,0)",
          "excel": {
            "bits": null,
            "display": "#NUM!",
            "kind": "error"
          },
          "input_route": "formula-literal",
          "inputs": [],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA"
        },
        {
          "call": "=COUPNUM(A1,400,2,0)",
          "excel": {
            "bits": null,
            "display": "#NUM!",
            "kind": "error"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "A1",
              "value": {
                "bits": "0x0000000000000000",
                "display": "0",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0.20527.20088 Current Channel, Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA"
        }
      ],
      "platform": "Windows 64-bit (NT 10.0.26200), x86-64, AMD Ryzen 7 4800H, en-ZA",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/3345a87/content/notes/FN-COUPNUM-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.COUPNUM.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.COUPNUM.json"
      ]
    }
  ]
}