{
  "category": "Financial functions",
  "display_name": "COUPDAYS",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.COUPDAYS",
  "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#L171-L174",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/ported/coupon_family.rs#L131-L144",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/ported/coupon_family.rs#L292-L321"
      ],
      "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::actual_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#L171-L174",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 5,591 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.COUPDAYS.json",
  "name": "COUPDAYS",
  "notes": [
    {
      "basis": "All 5,584 rows of three recorded sets: 3,012 and 1,512 rows from build 20430, 1,060 from build 20131. The rule was recomputed independently from the calendar and matched all 5,566 number rows with settlement at serial 61 or later, on every basis. The other two number rows have settlement 0 and basis 0, and read 180. In a study of 42 ways to walk and measure the schedule, this was the only one to match all 965 rows with basis exactly 1.",
      "documentation": null,
      "evidence": [
        {
          "commit": "14910720ec396f241b46460ecab093f71733c5f5",
          "locator": "coupdays_kernel",
          "note": "the rule as implemented",
          "path": "crates/calc-func/src/ported/coupon_family.rs",
          "repository": "DnaCalc"
        },
        {
          "commit": "14910720ec396f241b46460ecab093f71733c5f5",
          "locator": "coupdays_actual_actual_uses_its_recorded_calendar_interval",
          "note": "six recorded calls pinned",
          "path": "crates/calc-func/tests/f3_financial.rs",
          "repository": "DnaCalc"
        },
        {
          "commit": "19d810d45ad46fe5d2ddf0f4f582dd603a881a91",
          "locator": null,
          "note": "the 42 schedule variants compared on 965 basis 1 rows",
          "path": "evidence/round24/coupon/coupon-calendar-summary.json",
          "repository": "DnaCalc-Research"
        },
        {
          "commit": "19d810d45ad46fe5d2ddf0f4f582dd603a881a91",
          "locator": null,
          "note": "5,584 of 5,584 rows matched",
          "path": "evidence/round24/coupon/coupdays-registered-delta.json",
          "repository": "DnaCalc-Research"
        },
        {
          "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
          "locator": "COUPDAYS",
          "note": "matched rows per function",
          "path": "crates/calc-func/witness-status.tsv",
          "repository": "DnaCalc"
        },
        {
          "commit": "4d5320dfdc385354469b4d506153357bb932ab08",
          "locator": null,
          "note": "1,512 recorded rows, inputs read again",
          "path": "runs/w111-5-20260924/answers/answers-w1115-coupdays.json.gz",
          "repository": "CalcFunc-Evidence"
        }
      ],
      "functions": [
        "FUNC.COUPDAYS",
        "FUNC.COUPNCD",
        "FUNC.COUPPCD"
      ],
      "inferred": "The rule reproduces every recorded row; that Excel's code works this way is inferred. For basis 1 no settlement or maturity before serial 61, where Excel's calendar differs from the Gregorian one, is in the recorded rows.",
      "kind": "quirk",
      "note_id": "FN-COUPDAYS-001",
      "open": [],
      "recorded_on": "2026-11-04",
      "repros": [
        {
          "call": "COUPDAYS(35748, 35976, 2, 1)",
          "correct": null,
          "excel": {
            "bits": "0x4066e00000000000",
            "display": "183",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e1748000000000",
                "display": "35748",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e1910000000000",
                "display": "35976",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H",
          "source": {
            "commit": "4d5320dfdc385354469b4d506153357bb932ab08",
            "locator": "COUPDAYS|0x40e1748000000000|0x40e1910000000000|0x4000000000000000|0x3ff0000000000000",
            "note": null,
            "path": "cache/oracle-20430/build-20430/COUPDAYS.jsonl.gz",
            "repository": "CalcFunc-Evidence"
          }
        },
        {
          "call": "COUPDAYS(36452, 36891, 4, 1)",
          "correct": null,
          "excel": {
            "bits": "0x4056c00000000000",
            "display": "91",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e1cc8000000000",
                "display": "36452",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e2036000000000",
                "display": "36891",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4010000000000000",
                "display": "4",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H",
          "source": {
            "commit": "4d5320dfdc385354469b4d506153357bb932ab08",
            "locator": "COUPDAYS|0x40e1cc8000000000|0x40e2036000000000|0x4010000000000000|0x3ff0000000000000",
            "note": null,
            "path": "cache/oracle-20430/build-20430/COUPDAYS.jsonl.gz",
            "repository": "CalcFunc-Evidence"
          }
        },
        {
          "call": "COUPDAYS(36812, 47907, 4, 1)",
          "correct": null,
          "excel": {
            "bits": "0x4057000000000000",
            "display": "92",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e1f98000000000",
                "display": "36812",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e7646000000000",
                "display": "47907",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4010000000000000",
                "display": "4",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H",
          "source": {
            "commit": "4d5320dfdc385354469b4d506153357bb932ab08",
            "locator": "COUPDAYS|0x40e1f98000000000|0x40e7646000000000|0x4010000000000000|0x3ff0000000000000",
            "note": null,
            "path": "cache/oracle-20430/build-20430/COUPDAYS.jsonl.gz",
            "repository": "CalcFunc-Evidence"
          }
        },
        {
          "call": "COUPDAYS(37015, 38137, 4, 1)",
          "correct": null,
          "excel": {
            "bits": "0x4056400000000000",
            "display": "89",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e212e000000000",
                "display": "37015",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e29f2000000000",
                "display": "38137",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4010000000000000",
                "display": "4",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H",
          "source": {
            "commit": "4d5320dfdc385354469b4d506153357bb932ab08",
            "locator": "COUPDAYS|0x40e212e000000000|0x40e29f2000000000|0x4010000000000000|0x3ff0000000000000",
            "note": null,
            "path": "cache/oracle-20430/build-20430/COUPDAYS.jsonl.gz",
            "repository": "CalcFunc-Evidence"
          }
        },
        {
          "call": "COUPDAYS(38044, 38411, 2, 1)",
          "correct": null,
          "excel": {
            "bits": "0x4067000000000000",
            "display": "184",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e2938000000000",
                "display": "38044",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e2c16000000000",
                "display": "38411",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H",
          "source": {
            "commit": "4d5320dfdc385354469b4d506153357bb932ab08",
            "locator": "COUPDAYS|0x40e2938000000000|0x40e2c16000000000|0x4000000000000000|0x3ff0000000000000",
            "note": null,
            "path": "cache/oracle-20430/build-20430/COUPDAYS.jsonl.gz",
            "repository": "CalcFunc-Evidence"
          }
        },
        {
          "call": "COUPDAYS(34911, 35216, 2, 1)",
          "correct": null,
          "excel": {
            "bits": "0x4066e00000000000",
            "display": "183",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e10be000000000",
                "display": "34911",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e1320000000000",
                "display": "35216",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H",
          "source": {
            "commit": "4d5320dfdc385354469b4d506153357bb932ab08",
            "locator": "COUPDAYS|0x40e10be000000000|0x40e1320000000000|0x4000000000000000|0x3ff0000000000000",
            "note": null,
            "path": "cache/oracle-20430/build-20430/COUPDAYS.jsonl.gz",
            "repository": "CalcFunc-Evidence"
          }
        },
        {
          "call": "COUPPCD(44043, 2958465, 2, 1)",
          "correct": null,
          "excel": {
            "bits": "0x40e57d8000000000",
            "display": "44012",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e5816000000000",
                "display": "44043",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x4146924080000000",
                "display": "2958465",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H",
          "source": {
            "commit": "4d5320dfdc385354469b4d506153357bb932ab08",
            "locator": "COUPPCD|0x40e5816000000000|0x4146924080000000|0x4000000000000000|0x3ff0000000000000",
            "note": null,
            "path": "cache/oracle-20430/build-20430/COUPPCD.jsonl.gz",
            "repository": "CalcFunc-Evidence"
          }
        },
        {
          "call": "COUPNCD(44043, 2958465, 2, 1)",
          "correct": null,
          "excel": {
            "bits": "0x40e5948000000000",
            "display": "44196",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e5816000000000",
                "display": "44043",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x4146924080000000",
                "display": "2958465",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H",
          "source": {
            "commit": "4d5320dfdc385354469b4d506153357bb932ab08",
            "locator": "COUPNCD|0x40e5816000000000|0x4146924080000000|0x4000000000000000|0x3ff0000000000000",
            "note": null,
            "path": "cache/oracle-20430/build-20430/COUPNCD.jsonl.gz",
            "repository": "CalcFunc-Evidence"
          }
        },
        {
          "call": "COUPDAYS(44043, 2958465, 2, 1)",
          "correct": null,
          "excel": {
            "bits": "0x4066e00000000000",
            "display": "183",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e5816000000000",
                "display": "44043",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x4146924080000000",
                "display": "2958465",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H",
          "source": {
            "commit": "4d5320dfdc385354469b4d506153357bb932ab08",
            "locator": "COUPDAYS|0x40e5816000000000|0x4146924080000000|0x4000000000000000|0x3ff0000000000000",
            "note": null,
            "path": "cache/oracle-20430/build-20430/COUPDAYS.jsonl.gz",
            "repository": "CalcFunc-Evidence"
          }
        }
      ],
      "schema": "efh.function-note/v1",
      "statement": "On basis 1 (actual/actual) COUPDAYS does not always equal COUPNCD minus COUPPCD. Its rule: start at maturity and step back by 12/frequency months. Each step keeps the day of the month and clamps it to the length of the target month, and the clamped date is the start of the next step, so passing through February lowers the day for every earlier date. Stop at the last date still after settlement, call it next. The answer is the number of actual days from one period before next up to next, and this last step keeps month ends: if next is the last day of its month, the start is the last day of its month. On the other bases the answer is 360/frequency (bases 0, 2, 4) or 365/frequency (basis 3). With this rule, all 5,584 recorded rows match (4,072 distinct inputs): 5,568 numbers and 16 #NUM!, from Excel builds 20131 and 20430. Of the 967 basis 1 rows, 81 (49 distinct inputs) differ from the day count between the dates of a schedule anchored on maturity with month ends kept. For maturity 1998-06-30 with semi-annual coupons, COUPDAYS(35748,35976,2,1) is 183, from 1997-06-30 to 1997-12-30; the anchored schedule gives 184. In one recorded case all three functions were read on the same inputs: COUPNCD(44043,2958465,2,1) less COUPPCD is 44196 - 44012 = 184, and COUPDAYS is 183.",
      "status": "measured",
      "title": "On basis 1 COUPDAYS walks back from maturity by its own rule, not COUPPCD to COUPNCD"
    },
    {
      "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)** and **[COUPDAYSNC](FUNC.COUPDAYSNC.md)** — the numerators\n  this function is the denominator of. Read the additivity section above before assuming they\n  sum to it.\n- **[COUPNCD](FUNC.COUPNCD.md)** and **[COUPPCD](FUNC.COUPPCD.md)** — the two dates that bound\n  the period whose length this function reports. Note that `COUPNCD − COUPPCD` is the *actual*\n  length, which equals `COUPDAYS` only under basis 1, and not always there: FN-COUPDAYS-001\n  records 184 against 183.\n- **[COUPNUM](FUNC.COUPNUM.md)** — how many such periods remain.\n- **`PRICE`, `YIELD`, `DURATION`, `MDURATION`, `ODDFPRICE`** — the consumers, all of which form\n  `COUPDAYSNC / COUPDAYS` as a discounting exponent or `COUPDAYBS / COUPDAYS` as an accrual\n  fraction.\n- **[YEARFRAC](FUNC.YEARFRAC.md)** — the general day-count engine. `COUPDAYS` is *not*\n  `YEARFRAC` scaled: `YEARFRAC` always measures a real interval, while `COUPDAYS` mostly quotes\n  a convention.\n- **Confused with**: `COUPNCD(...) − COUPPCD(...)`, which is the actual number of days in the\n  period and differs from `COUPDAYS` on every basis except 1, and on basis 1 in the cases\n  FN-COUPDAYS-001 records.\n\n\n",
    "how-to-implement": "\n### Numerical notes\n\n\n1. **Three of the five answers are exact in binary; one is not.** 360, 180, 90, 365 and 91.25\n   are all exactly representable; `365/2 = 182.5` is exact too. In fact all ten constants are\n   exactly representable, so `COUPDAYS` itself has no rounding error — but the *quotients* built\n   from it do, and forming `a / (365/frequency)` is not the same as forming `a × frequency / 365`.\n   A consumer targeting Excel compatibility must pin which.\n2. **Basis 1's answer is an integer day count** and can be computed in integer arithmetic\n   throughout. Doing so removes a whole class of bugs.\n3. **The period-start anchor for basis 1 is a decision.** Whether the actual length is measured\n   from the clamped period start or from the raw backward step is a real fork in the reference\n   engine's own code. Excel's rule is in FN-COUPDAYS-001: a clamped walk back from `maturity`, with\n   month ends kept only on the last step.\n4. **Do not implement `COUPDAYS` as a subtraction of the two other counts, or vice versa.** The\n   additivity failure above means each of the three has to be computed on its own terms. The\n   upstream research record shows what happens when a production implementation takes the\n   shortcut.\n5. There is no argument reduction, no cancellation and no transcendental here. Every difficulty\n   in this function is definitional.\n\n\n",
    "quirks": "\n### Why the answer is often not a whole number of days\n\n\nHere is the thing that surprises readers: **`COUPDAYS` does not always count days.** For four of\nthe five bases it returns a convention, and the convention need not be an integer.\n\n| `basis` | What `COUPDAYS` returns |\n|---|---|\n| 0 — US (NASD) 30/360 | `360 / frequency` |\n| 1 — Actual/actual | the actual calendar length of the period containing `settlement` |\n| 2 — Actual/360 | `360 / frequency` |\n| 3 — Actual/365 | `365 / frequency` |\n| 4 — European 30/360 | `360 / frequency` |\n\nSo at `frequency` 2 the answers are 180, 180, 182.5 and 180 for bases 0, 2, 3 and 4 — and\n`182.5` is not a number of days that any calendar contains. Under basis 1 the answer really is a\nday count, and it varies from period to period: semiannual periods are 181, 182, 183 or 184 days\nlong depending on which months they span and whether a leap day falls inside.\n\nThe logic is coherent once stated: a `/360` or `/365` basis *declares* a year length, and the\ncoupon period is by definition a `1/frequency` share of that declared year. Only actual/actual\ndeclines to declare one and measures the calendar instead. But the practical consequence is\nworth stating plainly: **basis 2 is \"actual/360\", and yet `COUPDAYS` under basis 2 ignores the\nactual calendar entirely.** The \"actual\" in the name governs the numerator, not the denominator.\n\n\n### The additivity that fails\n\n\nThe obvious identity is\n\n>     COUPDAYBS + COUPDAYSNC  =  COUPDAYS\n\nThe reason follows directly from the table above and the corresponding one on\n[COUPDAYBS](FUNC.COUPDAYBS.md): under bases 2 and 3 the two *numerator* functions count real\ncalendar days, while `COUPDAYS` returns a declared 180 or 182.5. A 184-day real period reported\nas a 180-day period cannot have its two halves add up.\n\nThis is not a defect in the family so much as a fault line running through it, and it has\nalready produced observable divergence upstream. The Handbook's research record documents a case\nin the same bond model where Excel's `PRICE` derives its days-to-next-coupon as\n*period length minus accrued days* rather than counting them directly — which agrees with\n`COUPDAYSNC` on 30/360 and actual/actual bases, apart from the basis 0 cases of FN-COUPDAYSNC-001,\nand disagrees with it, by whole days, on actual/360 and actual/365. Excel published both numbers, in\nthe same workbook, for the same bond. That episode is exactly this additivity failure, seen from the\nconsumer's side.\n\nThe reader's practical rule: **on bases 0, 2 and 3, do not derive any of the three day counts\nfrom the other two.** Ask for each one.\n\n\n\n### Result and edge cases\n\n\nReturns a `Number`, which may be fractional (182.5 at basis 3, `frequency` 2) and is not always\na possible day count.\n\n- **Basis 1 across a leap day** gives a longer period than the same schedule position in a\n  non-leap year. This is the only basis under which `COUPDAYS` varies with the settlement date\n  at all.\n- **`frequency` 1, 2, 4** are the only admitted values, so the constants are 360, 180, 90 (bases\n  0, 2, 4) and 365, 182.5, 91.25 (basis 3).\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.CoupDays method (Excel)** —\n  <https://learn.microsoft.com/en-us/office/vba/api/excel.worksheetfunction.coupdays>. Source of\n  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, **COUPDAYS function** —\n  <https://support.microsoft.com/en-us/office/coupdays-function-cc64380b-315b-4e7b-950c-b30b0a76f671>.\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, `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 `COUPDAYSNC` on the\n  actual/360 and actual/365 bases.\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.COUPDAYS.json`, `data/presence/FUNC.COUPDAYS.json`,\n  `data/battery/FUNC.COUPDAYS.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.COUPDAYS.json).",
    "what-it-does": "\n`COUPDAYS(settlement, maturity, frequency, [basis])` returns **the number of days in the coupon\nperiod that contains the settlement date**.\n\nIt is the denominator of every accrual fraction in bond arithmetic. Accrued interest is\n`COUPDAYBS / COUPDAYS` of a coupon; the discounting exponent in `PRICE` is\n`COUPDAYSNC / COUPDAYS`. Get this function wrong and every price and yield built on it is wrong\nby the same proportion.\n\nThe coupon period is determined by the schedule described on\n[COUPNCD](FUNC.COUPNCD.md#the-coupon-schedule): coupon dates run backwards from `maturity` in\nsteps of `12/frequency` months, and `settlement` selects one period from that ladder. On basis 1\nExcel's period comes from its own walk back from `maturity` (FN-COUPDAYS-001).\n\n\n\n### Arguments\n\n\n`COUPDAYS(settlement, maturity, frequency, [basis])` — the family's shared four arguments;\nMicrosoft's argument descriptions and the five-row basis table are quoted on\n[COUPNCD](FUNC.COUPNCD.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\nUnlike its five siblings, `COUPDAYS` genuinely depends on `basis` in the strongest possible way:\n`basis` chooses between \"measure the calendar\" and \"quote a convention\". Omitting `basis` asks\nfor 30/360, and gets a flat `360/frequency` for every period of every bond.\n\nMicrosoft documents that **\"All arguments are truncated to integers.\"**\n\n\n"
  },
  "signature": {
    "display": "COUPDAYS(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 in the coupon period that holds the settlement date",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the number of days in the coupon period that contains the settlement date",
        "microsoft_url": "https://support.microsoft.com/en-us/office/coupdays-function-cc64380b-315b-4e7b-950c-b30b0a76f671"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "COUPDAYS"
        },
        {
          "locale": "bg-BG",
          "name": "COUPDAYS"
        },
        {
          "locale": "cs-CZ",
          "name": "COUPDAYS"
        },
        {
          "locale": "da-DK",
          "name": "KUPONDAGE.A"
        },
        {
          "locale": "de-DE",
          "name": "COUPDAYS"
        },
        {
          "locale": "el-GR",
          "name": "COUPDAYS"
        },
        {
          "locale": "en-AU",
          "name": "COUPDAYS"
        },
        {
          "locale": "en-GB",
          "name": "COUPDAYS"
        },
        {
          "locale": "en-US",
          "name": "COUPDAYS"
        },
        {
          "locale": "es-ES",
          "name": "COUPDACUPON.DIAS"
        },
        {
          "locale": "et-EE",
          "name": "COUPDAYS"
        },
        {
          "locale": "fi-FI",
          "name": "KORKOPÄIVÄT"
        },
        {
          "locale": "fr-FR",
          "name": "NB.JOURS.COUPONS*"
        },
        {
          "locale": "he-IL",
          "name": "COUPDAYS"
        },
        {
          "locale": "hr-HR",
          "name": "COUPDAYS"
        },
        {
          "locale": "hu-HU",
          "name": "SZELVÉNYIDŐ"
        },
        {
          "locale": "id-ID",
          "name": "COUPDAYS"
        },
        {
          "locale": "it-IT",
          "name": "COUPDAYS"
        },
        {
          "locale": "ja-JP",
          "name": "COUPDAYS"
        },
        {
          "locale": "ko-KR",
          "name": "COUPDAYS"
        },
        {
          "locale": "lt-LT",
          "name": "COUPDAYS"
        },
        {
          "locale": "lv-LV",
          "name": "COUPDAYS"
        },
        {
          "locale": "nb-NO",
          "name": "OBLIG.DAGER"
        },
        {
          "locale": "nl-NL",
          "name": "COUP.DAGEN"
        },
        {
          "locale": "pl-PL",
          "name": "WYPŁ.DNI"
        },
        {
          "locale": "pt-BR",
          "name": "COUPDAYS"
        },
        {
          "locale": "pt-PT",
          "name": "CUPDIAS"
        },
        {
          "locale": "ro-RO",
          "name": "COUPDAYS"
        },
        {
          "locale": "ru-RU",
          "name": "ДНЕЙКУПОН"
        },
        {
          "locale": "sk-SK",
          "name": "COUPDAYS"
        },
        {
          "locale": "sl-SI",
          "name": "COUPDAYS"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "COUPDAYS"
        },
        {
          "locale": "sv-SE",
          "name": "KUPDAGB"
        },
        {
          "locale": "th-TH",
          "name": "COUPDAYS"
        },
        {
          "locale": "tr-TR",
          "name": "KUPONGÜN işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "COUPDAYS"
        },
        {
          "locale": "vi-VN",
          "name": "COUPDAYS"
        },
        {
          "locale": "zh-CN",
          "name": "COUPDAYS"
        },
        {
          "locale": "zh-HK",
          "name": "COUPDAYS"
        },
        {
          "locale": "zh-TW",
          "name": "COUPDAYS"
        }
      ],
      "signature": {
        "display": "COUPDAYS(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": "COUPDAYS",
      "version_marker": null,
      "xlcall": {
        "code": "453",
        "symbol": "xlfCoupdays"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/coupdays-function-cc64380b-315b-4e7b-950c-b30b0a76f671"
  },
  "try_it": {
    "formula": "=COUPDAYS(35748, 35976, 2, 1)"
  },
  "url": "https://handbook.dnacalc.com/functions/COUPDAYS.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "COUPDAYS(35748, 35976, 2, 1) returned 183 (0x4066e00000000000). COUPDAYS(36452, 36891, 4, 1) returned 91 (0x4056c00000000000). 5 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 build 20430",
      "observations": [
        {
          "call": "COUPDAYS(35748, 35976, 2, 1)",
          "excel": {
            "bits": "0x4066e00000000000",
            "display": "183",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e1748000000000",
                "display": "35748",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e1910000000000",
                "display": "35976",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H"
        },
        {
          "call": "COUPDAYS(36452, 36891, 4, 1)",
          "excel": {
            "bits": "0x4056c00000000000",
            "display": "91",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e1cc8000000000",
                "display": "36452",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e2036000000000",
                "display": "36891",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4010000000000000",
                "display": "4",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H"
        },
        {
          "call": "COUPDAYS(36812, 47907, 4, 1)",
          "excel": {
            "bits": "0x4057000000000000",
            "display": "92",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e1f98000000000",
                "display": "36812",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e7646000000000",
                "display": "47907",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4010000000000000",
                "display": "4",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H"
        },
        {
          "call": "COUPDAYS(37015, 38137, 4, 1)",
          "excel": {
            "bits": "0x4056400000000000",
            "display": "89",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e212e000000000",
                "display": "37015",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e29f2000000000",
                "display": "38137",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4010000000000000",
                "display": "4",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H"
        },
        {
          "call": "COUPDAYS(38044, 38411, 2, 1)",
          "excel": {
            "bits": "0x4067000000000000",
            "display": "184",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e2938000000000",
                "display": "38044",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e2c16000000000",
                "display": "38411",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H"
        },
        {
          "call": "COUPDAYS(34911, 35216, 2, 1)",
          "excel": {
            "bits": "0x4066e00000000000",
            "display": "183",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e10be000000000",
                "display": "34911",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e1320000000000",
                "display": "35216",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H"
        },
        {
          "call": "COUPDAYS(44043, 2958465, 2, 1)",
          "excel": {
            "bits": "0x4066e00000000000",
            "display": "183",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e5816000000000",
                "display": "44043",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x4146924080000000",
                "display": "2958465",
                "kind": "number"
              }
            },
            {
              "name": "frequency",
              "value": {
                "bits": "0x4000000000000000",
                "display": "2",
                "kind": "number"
              }
            },
            {
              "name": "basis",
              "value": {
                "bits": "0x3ff0000000000000",
                "display": "1",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H"
        }
      ],
      "platform": "Windows 64-bit, AMD Ryzen 7 4800H",
      "sources": [
        "https://github.com/DnaCalc/ExcelFunctionsHandbook/blob/3345a87/content/notes/FN-COUPDAYS-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.COUPDAYS.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.COUPDAYS.json"
      ]
    }
  ]
}