{
  "category": "Financial functions",
  "display_name": "TBILLEQ",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.TBILLEQ",
  "implementation_state": {
    "answer_bank": {
      "excel_builds": [
        "20430"
      ],
      "larger_numeric": 0,
      "last_bit": 0,
      "matched": 3600,
      "other_mismatch": 0,
      "refused": 0,
      "rows": 3600,
      "unread": 0,
      "worst_ulp": 0
    },
    "detail": "Recorded: 3,600 in the answer bank and 11 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 3,611 recorded answers",
    "workbook_corpus": {
      "cells": 11,
      "matched": 11
    }
  },
  "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#L207-L210",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/ported/discount_bill_yearfrac_family.rs#L360-L386",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/ported/discount_bill_yearfrac_family.rs#L388-L411"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/bonds::bill_arguments",
        "catalogue/bonds::bill_out",
        "catalogue/financial::required_number",
        "catalogue/financial::date_1900",
        "locale::days_from_civil",
        "locale::civil_from_days",
        "locale::excel_serial_from_ymd",
        "locale::ymd_from_excel_serial",
        "ported/discount_bill_yearfrac_family::max_excel_serial",
        "ported/discount_bill_yearfrac_family::parse_date_serial",
        "ported/discount_bill_yearfrac_family::actual_days",
        "ported/discount_bill_yearfrac_family::tbill_days",
        "ported/discount_bill_yearfrac_family::map_discount_bill_yearfrac_error_to_ws",
        "ported/excel_numeric::excel_sqrt_staged"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/bonds.rs#L207-L210",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 3,611 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.TBILLEQ.json",
  "name": "TBILLEQ",
  "notes": [
    {
      "basis": "2,400 of 2,400 recorded rows with the stored square root; 2,399 without it. All 33 recorded rows with a number answer at DSM 366 fit t = 1, and none of the 17 of them in the run below fits 366/365.",
      "documentation": {
        "claim": "TBILLEQ is calculated as TBILLEQ = (365 x rate)/(360-(rate x DSM)); the page does not mention 182 days.",
        "source": "https://support.microsoft.com/en-us/office/tbilleq-function-2ab72d90-9b4d-4efe-9fc2-0f81f2c19c8c"
      },
      "evidence": [
        {
          "commit": "26bb1800d3b349e44d594bed5f8bb589b528ef10",
          "locator": "lines 435-466",
          "note": "recorded answers pinned",
          "path": "crates/calc-func/tests/f3_financial.rs",
          "repository": "DnaCalc"
        },
        {
          "commit": "f1774082865e3a5ab7dec27ead7aeebb73b078c2",
          "locator": "counts",
          "note": "staged square root against alternatives",
          "path": "evidence/round23/tbilleq-hard/summary.json",
          "repository": "DnaCalc-Research"
        },
        {
          "commit": "26bb1800d3b349e44d594bed5f8bb589b528ef10",
          "locator": "lines 388-410",
          "note": "the arithmetic in the product",
          "path": "crates/calc-func/src/ported/discount_bill_yearfrac_family.rs",
          "repository": "DnaCalc"
        }
      ],
      "functions": [
        "FUNC.TBILLEQ"
      ],
      "inferred": null,
      "kind": "documentation-differs",
      "note_id": "FN-TBILLEQ-001",
      "open": [],
      "recorded_on": "2026-11-04",
      "repros": [
        {
          "call": "TBILLEQ(40633.25, 40836.25, 0.21193100748125787)",
          "correct": {
            "bits": "0x3fcedc78c550ced7",
            "display": "0.24110326418450853",
            "how": "mpmath at 800 bits: the exact quadratic at the binary64 inputs, correctly rounded.",
            "kind": "number"
          },
          "excel": {
            "bits": "0x3fcedc78c550cec1",
            "display": "0.24110326418450792",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e3d72800000000",
                "display": "40633.25",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e3f08800000000",
                "display": "40836.25",
                "kind": "number"
              }
            },
            {
              "name": "discount",
              "value": {
                "bits": "0x3fcb208e2511f676",
                "display": "0.21193100748125787",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H",
          "source": {
            "commit": "4d5320dfdc385354469b4d506153357bb932ab08",
            "locator": "w1115-TBILLEQ-01109",
            "note": null,
            "path": "runs/w111-5-20260924/answers/answers-w1115-tbilleq.json.gz",
            "repository": "CalcFunc-Evidence"
          }
        },
        {
          "call": "TBILLEQ(53886, 54252, 0.4522540814812992)",
          "correct": null,
          "excel": {
            "bits": "0x3fe7137ffe3328bc",
            "display": "0.7211303677406913",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40ea4fc000000000",
                "display": "53886",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40ea7d8000000000",
                "display": "54252",
                "kind": "number"
              }
            },
            {
              "name": "discount",
              "value": {
                "bits": "0x3fdcf1bb1a5c75f4",
                "display": "0.4522540814812992",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H",
          "source": {
            "commit": "4d5320dfdc385354469b4d506153357bb932ab08",
            "locator": "w1115-TBILLEQ-00179",
            "note": null,
            "path": "runs/w111-5-20260924/answers/answers-w1115-tbilleq.json.gz",
            "repository": "CalcFunc-Evidence"
          }
        }
      ],
      "schema": "efh.function-note/v1",
      "statement": "When DSM is above 182, TBILLEQ does not use the documented formula. It uses the bond-equivalent quadratic (-t + sqrt(t^2 - (2t-1)(1 - 1/p))) / (t - 1/2), with t = DSM/365 and p = price/100. At DSM 366, a bill across a 29 February, t is 1 and not 366/365. The square root is taken in extended precision and stored, RN53(RN64(sqrt)); the rest is binary64. For the row below, DSM 203, the documented formula gives 0.244038 and Excel 0.241103. Excel's bits are 22 units below the correctly rounded quadratic because of that staging.",
      "status": "measured",
      "title": "For bills longer than 182 days TBILLEQ is a quadratic, not the documented formula"
    },
    {
      "basis": "8 recorded readings with an empty B1, one per function, each paired with a reading with TRUE in B1.",
      "documentation": null,
      "evidence": [
        {
          "commit": "c4c5dde7e2dcf735d2849835fc49769e2ab67ba7",
          "locator": "delivered_fn4_blank_date_references_read_serial_zero",
          "note": "recorded answers pinned",
          "path": "apps/dna-onecalc/tests/acceptance.rs",
          "repository": "DnaCalc"
        },
        {
          "commit": "2d0eddcac86413014643af81d646581d54ba57bc",
          "locator": "sheets qa031 and qa032, and the like pairs of each function",
          "note": "recorded readings",
          "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-arguments.capture.json",
          "repository": "DnaCalc"
        }
      ],
      "functions": [
        "FUNC.NETWORKDAYS",
        "FUNC.NETWORKDAYS.INTL",
        "FUNC.TBILLEQ",
        "FUNC.TBILLPRICE",
        "FUNC.TBILLYIELD",
        "FUNC.WORKDAY",
        "FUNC.WORKDAY.INTL",
        "FUNC.YEARFRAC"
      ],
      "inferred": null,
      "kind": "quirk",
      "note_id": "FN-WORKDAY-001",
      "open": [
        "An argument left empty in the call was not read here for YEARFRAC and the T-bill functions."
      ],
      "recorded_on": "2026-11-04",
      "repros": [
        {
          "call": "=NETWORKDAYS(B1,5)",
          "correct": null,
          "excel": {
            "bits": "0x4010000000000000",
            "display": "4",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "B1",
              "value": {
                "bits": null,
                "display": "(empty cell)",
                "kind": "blank"
              }
            }
          ],
          "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 qa032, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-arguments.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=NETWORKDAYS(B1,5)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#VALUE!",
            "kind": "error"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "B1",
              "value": {
                "bits": null,
                "display": "TRUE",
                "kind": "logical"
              }
            }
          ],
          "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 qa031, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-arguments.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=WORKDAY(B1,2)",
          "correct": null,
          "excel": {
            "bits": "0x4008000000000000",
            "display": "3",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "B1",
              "value": {
                "bits": null,
                "display": "(empty cell)",
                "kind": "blank"
              }
            }
          ],
          "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 qa054, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-arguments.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=WORKDAY(B1,2)",
          "correct": null,
          "excel": {
            "bits": null,
            "display": "#VALUE!",
            "kind": "error"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "B1",
              "value": {
                "bits": null,
                "display": "TRUE",
                "kind": "logical"
              }
            }
          ],
          "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 qa053, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-arguments.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=NETWORKDAYS.INTL(B1,5,1)",
          "correct": null,
          "excel": {
            "bits": "0x4010000000000000",
            "display": "4",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "B1",
              "value": {
                "bits": null,
                "display": "(empty cell)",
                "kind": "blank"
              }
            }
          ],
          "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 qa040, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-arguments.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=WORKDAY.INTL(B1,2,1)",
          "correct": null,
          "excel": {
            "bits": "0x4008000000000000",
            "display": "3",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "B1",
              "value": {
                "bits": null,
                "display": "(empty cell)",
                "kind": "blank"
              }
            }
          ],
          "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 qa062, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-arguments.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=YEARFRAC(B1,5,0)",
          "correct": null,
          "excel": {
            "bits": "0x3f8c71c71c71c71c",
            "display": "0.013888888888888888",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "B1",
              "value": {
                "bits": null,
                "display": "(empty cell)",
                "kind": "blank"
              }
            }
          ],
          "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 qa072, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-arguments.capture.json",
            "repository": "DnaCalc"
          }
        },
        {
          "call": "=TBILLEQ(B1,5,0.1)",
          "correct": null,
          "excel": {
            "bits": "0x3fb9fddd1b6a757f",
            "display": "0.10152990264255911",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "B1",
              "value": {
                "bits": null,
                "display": "(empty cell)",
                "kind": "blank"
              }
            }
          ],
          "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 qa082, row 20, column 10",
            "note": null,
            "path": "crates/calc-func/tests/captures/fn4_questions/functions-fn4-arguments.capture.json",
            "repository": "DnaCalc"
          }
        }
      ],
      "schema": "efh.function-note/v1",
      "statement": "A reference to an empty cell as the first date of these functions reads as serial 0 and gives a normal answer: NETWORKDAYS(B1,5) is 4 and WORKDAY(B1,2) is 3. YEARFRAC(B1,5,0) is 5/360. TRUE in the same cell gives #VALUE!, as a direct TRUE does, so a blank is not treated as the logical FALSE either.",
      "status": "measured",
      "title": "An empty cell as a first date is serial 0, but a logical in that cell is #VALUE!"
    }
  ],
  "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- **[TBILLYIELD](FUNC.TBILLYIELD.md)** — the yield of the same bill from its price, on a 360-day\n  year and with no long-bill branch. Up to 182 days, on the same bill,\n  `TBILLEQ = TBILLYIELD × 365/360`. Above that the relation fails.\n- **`TBILLPRICE`** — the price from the discount, which is the first step of this function.\n- **[DISC](FUNC.DISC.md)** — the general discount quotation with a `basis`. The T-bill functions fix\n  the convention and add the one-year limit.\n- **[INTRATE](FUNC.INTRATE.md)** — the simple rate on the investment. For bills up to 182 days,\n  `TBILLEQ` is `INTRATE` on an actual/365 footing.\n- **`YIELD`** — the coupon-bond yield that a bond-equivalent yield is built to be compared with.\n\n\n",
    "how-to-implement": "\n### Numerical notes\n\n\n**The first branch is plain.** One multiplication, one subtraction and one division. It has a pole\nat `d × DSM = 360`, which is where the price reaches zero, and Excel refuses from there on.\n\n**The second branch has a cancellation site.** The numerator is `−t` plus a square root that is close\nto `t`, and it is small when the yield is small or `t` is close to 1/2. The denominator `t − 1/2` is\nsmallest at `DSM = 183`, where it is `1/730`. The expression cannot be evaluated at `t = 1/2`, and\nthe integer day count keeps it away, because `DSM = 182.5` does not exist.\n\n**The exact arithmetic.** The note records how the square root is staged, and why Excel's answer on\nits row sits 22 units below the correctly rounded value of the quadratic. Reproducing Excel means\nfollowing that staging, not computing the quadratic more accurately. The note's count applies to\nthe same 2,400 rows, and one row separates the staged result from the plain one, so this is a small\neffect measured on few rows.\n\n**Discriminant.** The value under the square root was positive on all 712 long-bill rows that\nreached it, so no row shows what a negative value would do. For `0 < p < 1` and `t > 1/2` the term\n`−(2t − 1)(1 − 1/p)` is positive, so it does not arise on admissible inputs.\n\n\n",
    "quirks": "\n### Result and edge cases\n\n\nReturns `Number`, an annualized yield as a decimal fraction.\n\nFigures in this section and the next are from the 2,400 rows behind the notes below (Excel 16.0\nbuild 20430, Windows 64-bit, AMD Ryzen 7 4800H) unless marked as a reading. Readings are from Excel\n16.0.20527.20088 on Windows, with bitness and CPU not recorded in the reading file.\n\n- **The branch point is exact in the rows.** The 992 numeric rows with `DSM ≤ 182` fit the documented\n  formula, including 48 at 182. The 712 numeric rows above it fit the quadratic, including 91 at 183.\n  No row above 182 fits the documented formula.\n- **A non-positive price is refused.** Where `d × DSM/360 ≥ 1` the bill would have no positive price,\n  and all 25 such rows inside the one-year limit return `#NUM!`.\n- **The one-year limit is a calendar rule.** The bound is the same month and day a year on, not a\n  count of days. A 366-day bill across a 29 February is allowed. From 28 February of the year before\n  a leap year, maturity on 29 February a year later is `#NUM!` (2 rows), although that is the last\n  day of the month. From 29 February, the 28 February a year later is allowed, and 2 March is `#NUM!`.\n- **Serial 0 works as a settlement date.** Readings give numbers for maturities of serial 1, 5, 365\n  and 366, and `#NUM!` for serial 367.\n- **The order of arguments decides which error appears.** Readings show the first failing argument\n  wins: `TBILLEQ(#REF!,TRUE,0.1)` is `#REF!` and `TBILLEQ(TRUE,#REF!,0.1)` is `#VALUE!`.\n\n\n\n### Errors\n\n\n| Error | Condition | Source |\n|---|---|---|\n| `#VALUE!` | `settlement` or `maturity` is not a valid date | Documented; see below |\n| `#NUM!` | `discount ≤ 0` | Documented; 60 rows inside the limit |\n| `#NUM!` | Maturity more than one year after settlement | Documented; 541 rows with no other fault |\n| `#NUM!` | `settlement > maturity` | Documented; reading at serial 1 and 0 |\n| `#NUM!` | `settlement = maturity` | Not documented; one reading |\n| `#NUM!` | `d × DSM/360 ≥ 1` | Not documented; 25 rows |\n| `#NUM!` | A negative or past-year-9999 serial | Differs from documentation; readings |\n| `#VALUE!` | A logical in any slot | Not documented; readings |\n\nThree of these depart from Microsoft's page, and both accounts are shown:\n\n- Microsoft's `TBILLEQ` page says `settlement > maturity`, where its `TBILLYIELD` page says\n  `settlement ≥ maturity`. The formula has a value at `DSM = 0`, so the difference is not vacuous. A\n  reading of `TBILLEQ(0,0,0.1)` returns `#NUM!`. That is the only equal-dates reading.\n- Microsoft says an invalid date is `#VALUE!`. Readings of settlement `−1`, `−0.5` and 2958466 (the\n  first serial past 31 December 9999) all return `#NUM!`, so an out-of-range number is not treated\n  that way. The `#VALUE!` measured for a date argument is the logical one.\n- Microsoft does not mention a price that reaches zero.\n\n",
    "sources": "- Microsoft, \"TBILLEQ function\" —\n  <https://support.microsoft.com/en-us/office/tbilleq-function-2ab72d90-9b4d-4efe-9fc2-0f81f2c19c8c>\n  (syntax, argument meanings, the serial-date and truncation remarks, the `#VALUE!` and `#NUM!`\n  conditions, the formula and its `DSM` wording, and the worked example). The page does not mention\n  182 days.\n- Microsoft, \"TBILLYIELD function\" —\n  <https://support.microsoft.com/en-us/office/tbillyield-function-6d381232-f4b0-4cd5-8e97-45b9c03468ba>\n  (the `settlement ≥ maturity` wording compared above).\n- The function notes on this page, and the recorded Excel rows and readings their evidence lists\n  cite. The branch counts, the `DSM = 366` case, the one-year-limit cases, the error rows and the\n  serial and logical readings were read from those records for this page and go beyond the notes'\n  own text; each carries the Excel build stated in Result and edge cases.\n- Handbook evidence records `EV-FIN-0034` and `EV-STRUCT-0007`.\n- Handbook, [The value universe](../model/01-value-universe.md) and\n  [Coercion and lifting](../model/02-coercion-and-lifting.md).\n- Handbook, [Claim language and honesty](../model/06-claim-language.md) — the scoping rules this\n  page's claims are written under.\n- Handbook projections `data/functions/FUNC.TBILLEQ.json` and `data/presence/FUNC.TBILLEQ.json`\n  (arity, classification axes, implementing module and sibling set).\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| 20430 | Windows, 64-bit, AMD Ryzen 7 4800H with Radeon Graphics | 2,400 |\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.TBILLEQ.json).",
    "what-it-does": "\n`TBILLEQ(settlement, maturity, discount)` returns the **bond-equivalent yield** of a Treasury bill:\nthe yield that lets a bill quoted at a bank-discount rate be compared with a coupon bond.\n\nA bill's price per 100 follows from its discount rate `d` and the actual day count `DSM`:\n\n    price = 100 × (1 − d × DSM/360)\n\nWrite `p = price/100`. What happens next depends on how long the bill runs, and **Microsoft's page\ndescribes only one of the two cases.**\n\n| | Microsoft's page | What Excel does |\n|---|---|---|\n| `DSM` up to 182 | `(365 × rate) / (360 − rate × DSM)` | The same formula |\n| `DSM` above 182 | The same formula | The quadratic below |\n| `DSM` as a count | \"computed according to the 360 days per year basis\" | Actual days |\n\nFor the bill of 182 days or fewer, the two forms below are the same number:\n\n    TBILLEQ = (365 × d) / (360 − d × DSM)  =  (1/p − 1) × 365/DSM\n\nThat is a simple yield on the price, over a 365-day year.\n\nFor a bill of more than 182 days, Excel returns\n\n    TBILLEQ = (−t + √(t² − (2t − 1)(1 − 1/p))) / (t − 1/2)\n\nwith `t = DSM/365`, as recorded in the notes below. Microsoft's page does not mention 182 days or\nthis expression. Both accounts are shown here because they differ, and on the note's own row the\ndifference is large: 203 days at a discount of about 21.2%, where the documented formula gives\n0.244038 and Excel gives 0.241103.\n\n### Where the quadratic comes from\n\nA coupon bond pays every half year, so a bill longer than about half a year has to be compared with\na bond that has already paid once. The standard construction lets the first half year earn `y/2`,\nwith the interest reinvested, and the rest of the span earn simple interest at `y`:\n\n    p × (1 + y/2) × (1 + y × (t − 1/2)) = 1\n\nExpanding gives a quadratic in `y`, and its positive root is the expression above. That is algebra\nfrom the construction; Microsoft does not state it.\n\nThe table shows how the two compare at a 5% discount. These are formula values, not Excel readings.\n\n| `DSM` | Documented formula | Quadratic | Excel's branch |\n|---|---|---|---|\n| 91 | 0.051343 | not applied | documented |\n| 182 | 0.052009 | 0.052013 | documented |\n| 183 | 0.052017 | 0.052013 | quadratic |\n| 270 | 0.052670 | 0.052228 | quadratic |\n| 364 | 0.053394 | 0.052701 | quadratic |\n\n### The 366-day bill\n\nThe note writes `t = DSM/365`, and that holds with one exception. All 33 numeric rows with\n`DSM = 366` (for example 13 July 2047 to 13 July 2048, a span that crosses a 29 February) fit\n`t = 1`, that is `366/366`, and do not fit `366/365`. The 95 rows of shorter long bills across a 29\nFebruary keep 365. The one reading at this length, from serial 0 to serial 366, agrees.\n\n### The documented DSM wording\n\nMicrosoft says `DSM` is computed on a 360-day-year basis. Its own example does not bear that out:\n31 March 2008 to 1 June 2008 at 9.14% gives `0.0941515` with 62 actual days, matching the 9.42%\nMicrosoft shows, whereas a 30/360 count of 61 gives `0.0941272`, or 9.41%. The note's row is 203\nactual days where 30/360 would give 200. The 360 in the formula is the year length of the discount\nquotation; the day count is actual.\n\n\n\n### Arguments\n\n\n| Argument | Meaning | Default |\n|---|---|---|\n| `settlement` | The bill's settlement date, the date after issue when it trades to the buyer. Required. | — |\n| `maturity` | The date the bill expires. Required. | — |\n| `discount` | The bill's discount rate, as a decimal fraction. Required. | — |\n\nThere is no `basis`. The day count is always actual, and the conventions in the formulas are fixed.\nDates are documented as truncated to integers, and 205 of the 2,400 rows behind the notes carry a\nfractional date that fits this.\n\n`discount` is the bank-discount quotation, not a price and not a yield. The function that takes a\nprice is [TBILLYIELD](FUNC.TBILLYIELD.md).\n\n**Date arguments do not follow the ordinary to-number rules.** Logicals are refused with `#VALUE!`\nin all three slots, including `FALSE`. An empty cell as `settlement` reads as serial 0 and gives a\nnormal answer, as the notes below record: `TBILLEQ(B1,5,0.1)` is `36.5/359.5`. A direct `0` gives\nthe same answer. See [Coercion and lifting](../model/02-coercion-and-lifting.md) for the shared\nmodel these depart from.\n\n\n"
  },
  "signature": {
    "display": "TBILLEQ(settlement, maturity, discount)",
    "parameters": [
      {
        "description": null,
        "name": "settlement",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "maturity",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "discount",
        "optional": false,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 3,
        "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": "None",
        "thread_safety_class": "SafePure",
        "volatility_class": "NonVolatile"
      },
      "descriptions": {
        "long": null,
        "short": "Treasury bill yield restated as a bond-equivalent yield",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Returns the bond-equivalent yield for a Treasury bill",
        "microsoft_url": "https://support.microsoft.com/en-us/office/tbilleq-function-2ab72d90-9b4d-4efe-9fc2-0f81f2c19c8c"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "TBILLEQ"
        },
        {
          "locale": "bg-BG",
          "name": "TBILLEQ"
        },
        {
          "locale": "cs-CZ",
          "name": "TBILLEQ"
        },
        {
          "locale": "da-DK",
          "name": "STATSOBLIGATION"
        },
        {
          "locale": "de-DE",
          "name": "TBILLEQ"
        },
        {
          "locale": "el-GR",
          "name": "TBILLEQ"
        },
        {
          "locale": "en-AU",
          "name": "TBILLEQ"
        },
        {
          "locale": "en-GB",
          "name": "TBILLEQ"
        },
        {
          "locale": "en-US",
          "name": "TBILLEQ"
        },
        {
          "locale": "es-ES",
          "name": "LETRA.DE.TEST.EQV.A.BONO"
        },
        {
          "locale": "et-EE",
          "name": "TBILLEQ"
        },
        {
          "locale": "fi-FI",
          "name": "OBLIG.TUOTTOPROS"
        },
        {
          "locale": "fr-FR",
          "name": "TAUX.ESCOMPTE.R*"
        },
        {
          "locale": "he-IL",
          "name": "TBILLEQ"
        },
        {
          "locale": "hr-HR",
          "name": "TBILLEQ"
        },
        {
          "locale": "hu-HU",
          "name": "KJEGY.EGYENÉRT"
        },
        {
          "locale": "id-ID",
          "name": "TBILLEQ"
        },
        {
          "locale": "it-IT",
          "name": "TBILLEQ"
        },
        {
          "locale": "ja-JP",
          "name": "TBILLEQ"
        },
        {
          "locale": "ko-KR",
          "name": "TBILLEQ"
        },
        {
          "locale": "lt-LT",
          "name": "TBILLEQ"
        },
        {
          "locale": "lv-LV",
          "name": "TBILLEQ"
        },
        {
          "locale": "nb-NO",
          "name": "TBILLEKV"
        },
        {
          "locale": "nl-NL",
          "name": "SCHATK.OBL"
        },
        {
          "locale": "pl-PL",
          "name": "RENT.EKW.BS"
        },
        {
          "locale": "pt-BR",
          "name": "TBILLEQ"
        },
        {
          "locale": "pt-PT",
          "name": "OTN"
        },
        {
          "locale": "ro-RO",
          "name": "TBILLEQ"
        },
        {
          "locale": "ru-RU",
          "name": "РАВНОКЧЕК"
        },
        {
          "locale": "sk-SK",
          "name": "TBILLEQ"
        },
        {
          "locale": "sl-SI",
          "name": "TBILLEQ"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "TBILLEQ"
        },
        {
          "locale": "sv-SE",
          "name": "SSVXEKV"
        },
        {
          "locale": "th-TH",
          "name": "TBILLEQ"
        },
        {
          "locale": "tr-TR",
          "name": "HTAHEŞ işlevi"
        },
        {
          "locale": "uk-UA",
          "name": "TBILLEQ"
        },
        {
          "locale": "vi-VN",
          "name": "TBILLEQ"
        },
        {
          "locale": "zh-CN",
          "name": "TBILLEQ"
        },
        {
          "locale": "zh-HK",
          "name": "TBILLEQ"
        },
        {
          "locale": "zh-TW",
          "name": "TBILLEQ"
        }
      ],
      "signature": {
        "display": "TBILLEQ(settlement, maturity, discount)",
        "parameters": [
          {
            "description": null,
            "name": "settlement",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "maturity",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "discount",
            "optional": false,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "TBILLEQ",
      "version_marker": null,
      "xlcall": {
        "code": "438",
        "symbol": "xlfTbilleq"
      }
    },
    "microsoft": "https://support.microsoft.com/en-us/office/tbilleq-function-2ab72d90-9b4d-4efe-9fc2-0f81f2c19c8c"
  },
  "try_it": {
    "formula": "=TBILLEQ(DATE(2024,1,1),DATE(2024,7,1),0.05)"
  },
  "url": "https://handbook.dnacalc.com/functions/TBILLEQ.html",
  "variants": [],
  "versions": [
    {
      "behaviour": "TBILLEQ(40633.25, 40836.25, 0.21193100748125787) returned 0.24110326418450792 (0x3fcedc78c550cec1). TBILLEQ(53886, 54252, 0.4522540814812992) returned 0.7211303677406913 (0x3fe7137ffe3328bc). 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": "TBILLEQ(40633.25, 40836.25, 0.21193100748125787)",
          "excel": {
            "bits": "0x3fcedc78c550cec1",
            "display": "0.24110326418450792",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40e3d72800000000",
                "display": "40633.25",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40e3f08800000000",
                "display": "40836.25",
                "kind": "number"
              }
            },
            {
              "name": "discount",
              "value": {
                "bits": "0x3fcb208e2511f676",
                "display": "0.21193100748125787",
                "kind": "number"
              }
            }
          ],
          "recorded_in": "Excel 16.0 build 20430, Windows 64-bit, AMD Ryzen 7 4800H"
        },
        {
          "call": "TBILLEQ(53886, 54252, 0.4522540814812992)",
          "excel": {
            "bits": "0x3fe7137ffe3328bc",
            "display": "0.7211303677406913",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "settlement",
              "value": {
                "bits": "0x40ea4fc000000000",
                "display": "53886",
                "kind": "number"
              }
            },
            {
              "name": "maturity",
              "value": {
                "bits": "0x40ea7d8000000000",
                "display": "54252",
                "kind": "number"
              }
            },
            {
              "name": "discount",
              "value": {
                "bits": "0x3fdcf1bb1a5c75f4",
                "display": "0.4522540814812992",
                "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-TBILLEQ-001.json"
      ]
    },
    {
      "behaviour": "=TBILLEQ(B1,5,0.1) returned 0.10152990264255911 (0x3fb9fddd1b6a757f). 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": "=TBILLEQ(B1,5,0.1)",
          "excel": {
            "bits": "0x3fb9fddd1b6a757f",
            "display": "0.10152990264255911",
            "kind": "number"
          },
          "input_route": "cell-value2",
          "inputs": [
            {
              "name": "B1",
              "value": {
                "bits": null,
                "display": "(empty cell)",
                "kind": "blank"
              }
            }
          ],
          "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-WORKDAY-001.json"
      ]
    },
    {
      "behaviour": "2,400 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.TBILLEQ.json"
      ]
    }
  ]
}