{
  "category": "Math and trigonometry functions",
  "display_name": "SEQUENCE",
  "entry_kind": "built_in_function",
  "eval_api": {
    "method": "POST",
    "url": "https://handbook.dnacalc.com/api/eval"
  },
  "function_id": "FUNC.SEQUENCE",
  "implementation_state": {
    "answer_bank": null,
    "detail": "Recorded: 52 workbook cells.",
    "dnacalc_commit": "9e1884369a678158dd82d3d74188daf986995e87",
    "in_catalogue": true,
    "state": "matches",
    "state_label": "Matches every recorded Excel answer",
    "summary": "Matches all 52 recorded answers",
    "workbook_corpus": {
      "cells": 52,
      "matched": 52
    }
  },
  "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/arrays.rs#L630-L632",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/arrays.rs#L617-L626",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/ported/dynamic_array_reshape_family.rs#L97-L102",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/ported/dynamic_array_reshape_family.rs#L1044-L1098",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/ported/dynamic_array_reshape_family.rs#L1104-L1115",
        "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/ported/dynamic_array_reshape_family.rs#L1118-L1124"
      ],
      "repository": "https://github.com/DnaCalc/DnaCalc",
      "shared_code": [
        "catalogue/arrays::result",
        "ported/dynamic_array_reshape_family::coerce_prepared_to_number",
        "ported/dynamic_array_reshape_family::scalar_cell",
        "ported/dynamic_array_reshape_family::get",
        "ported/dynamic_array_reshape_family::build_array",
        "ported/dynamic_array_reshape_family::map_dynamic_array_reshape_error_to_ws"
      ],
      "source": "https://github.com/DnaCalc/DnaCalc/blob/9e1884369a678158dd82d3d74188daf986995e87/crates/calc-func/src/catalogue/arrays.rs#L630-L632",
      "state": "matches",
      "suite": null,
      "summary": "Matches all 52 recorded answers"
    }
  ],
  "json_url": "https://handbook.dnacalc.com/api/functions/FUNC.SEQUENCE.json",
  "name": "SEQUENCE",
  "notes": [],
  "schema": "efh.function-reference/v1",
  "section_order": [
    "what-it-does",
    "try-it",
    "quirks",
    "how-to-implement",
    "version-differences",
    "alternatives"
  ],
  "sections": {
    "alternatives": "\n[MAKEARRAY](FUNC.MAKEARRAY.md) computes each entry from coordinates; [RANDARRAY](FUNC.RANDARRAY.md) generates random entries; [SCAN](FUNC.SCAN.md) returns intermediate accumulator values.\n\n\n",
    "how-to-implement": "\n1. Prepare all four arguments, preserving formed worksheet errors. Apply the defaults before dimension checks; omission and numeric zero are different cases.\n2. Require finite, positive integer row and column counts. Check their product for overflow and against the host’s output limit before allocating.\n3. For zero-based output index `i`, compute `start+i*step` with a multiply followed by an add. Store it at row `i div columns`, column `i mod columns`.\n4. Return an array with the requested shape. The workbook host checks its spill destination.\n\nThis is the current code’s direct-index calculation. Do not silently replace it with repeated `previous+step`: accumulated rounding can change the sequence. For example, the current route for `SEQUENCE(1,3,10000000000000000,1)` gives `10000000000000000`, `10000000000000000`, `10000000000000002`; repeated binary64 addition of one would stay at the first value. This distinguishes two implementable algorithms, not an identified arithmetic route for every Excel build.\n\n\n",
    "quirks": "\nThe output needs enough free worksheet cells to spill. The function’s array result and the workbook’s placement decision are separate: a correct two-by-three array can still encounter a spill obstruction. Microsoft documents limited support for dynamic arrays linked across workbooks; closing the source workbook can give `#REF!` when the link refreshes.\n\nThe current numeric implementation accepts positive integer dimensions. A zero dimension gives `#CALC!`; a negative or fractional dimension gives `#VALUE!`. Omitted or blank arguments take their defaults. These error choices come from the implementation, since the opened Microsoft function page does not enumerate those dimension errors.\n\n\n",
    "sources": "\n- [Microsoft: SEQUENCE function](https://support.microsoft.com/en-us/office/sequence-function-57467a98-57e0-4817-9f14-2eb78519ca90), opened 6 November 2026; syntax, documented argument rules and errors.\n- [DnaCalc SEQUENCE preparation and direct-index generation, `SequenceWork`](https://github.com/DnaCalc/DnaCalc/blob/da3ecc4fb19a3a5529708c311d0e8f05688ac165/crates/calc-func/src/ported/dynamic_array_reshape_family.rs).\n\n",
    "try-it": "\n`=SEQUENCE(2,3,10,2)` spills these two rows:\n\n| Column 1 | Column 2 | Column 3 |\n|---:|---:|---:|\n| 10 | 12 | 14 |\n| 16 | 18 | 20 |\n\nThe sequence continues across the first row before moving to the second. `=SEQUENCE(,3,5,2)` produces one row, `5,7,9`. A negative step descends, while a zero step repeats the start value.\n\n\n",
    "version-differences": "\nNo same-input comparison between named Excel builds is recorded for this function here. The documented behaviour below is not a measurement of every Excel release.\n\n\n",
    "what-it-does": "\n`SEQUENCE(rows, [columns], [start], [step])` creates a rectangular array of regularly spaced numbers. Optional arguments default to one. Microsoft also permits omitting `rows` when at least one other argument is supplied; the missing row count then defaults to one.\n\n\n"
  },
  "signature": {
    "display": "SEQUENCE(rows, [columns], [start], [step])",
    "parameters": [
      {
        "description": null,
        "name": "rows",
        "optional": false,
        "repeats": false
      },
      {
        "description": null,
        "name": "columns",
        "optional": true,
        "repeats": false
      },
      {
        "description": null,
        "name": "start",
        "optional": true,
        "repeats": false
      },
      {
        "description": null,
        "name": "step",
        "optional": true,
        "repeats": false
      }
    ],
    "trailing_repeats": false
  },
  "sources": {
    "metadata": {
      "admission": {
        "label": "implemented",
        "reason": null
      },
      "arity": {
        "max": 4,
        "min": 1
      },
      "category": "Math and trigonometry 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": "An array of evenly spaced numbers of a given size",
        "short_source": "dna-calc-own"
      },
      "docs": {
        "english_description": "Generates a list of sequential numbers in an array, such as 1, 2, 3, 4",
        "microsoft_url": "https://support.microsoft.com/en-us/office/sequence-function-57467a98-57e0-4817-9f14-2eb78519ca90"
      },
      "entry_kind": "built_in_function",
      "localized_family_names": null,
      "localized_names": [
        {
          "locale": "ar-SA",
          "name": "SEQUENCE"
        },
        {
          "locale": "bg-BG",
          "name": "SEQUENCE"
        },
        {
          "locale": "cs-CZ",
          "name": "SEQUENCE"
        },
        {
          "locale": "da-DK",
          "name": "SEKVENS"
        },
        {
          "locale": "de-DE",
          "name": "SEQUENCE"
        },
        {
          "locale": "el-GR",
          "name": "SEQUENCE"
        },
        {
          "locale": "en-AU",
          "name": "SEQUENCE"
        },
        {
          "locale": "en-GB",
          "name": "SEQUENCE"
        },
        {
          "locale": "en-US",
          "name": "SEQUENCE"
        },
        {
          "locale": "es-ES",
          "name": "SECUENCIA"
        },
        {
          "locale": "et-EE",
          "name": "SEQUENCE"
        },
        {
          "locale": "fi-FI",
          "name": "SEKVENSSI"
        },
        {
          "locale": "fr-FR",
          "name": "SEQUENCE*"
        },
        {
          "locale": "he-IL",
          "name": "SEQUENCE"
        },
        {
          "locale": "hr-HR",
          "name": "SEQUENCE"
        },
        {
          "locale": "hu-HU",
          "name": "SORSZÁMLISTA"
        },
        {
          "locale": "id-ID",
          "name": "SEQUENCE"
        },
        {
          "locale": "it-IT",
          "name": "SEQUENCE"
        },
        {
          "locale": "ja-JP",
          "name": "SEQUENCE"
        },
        {
          "locale": "ko-KR",
          "name": "SEQUENCE"
        },
        {
          "locale": "lt-LT",
          "name": "SEQUENCE"
        },
        {
          "locale": "lv-LV",
          "name": "SEQUENCE"
        },
        {
          "locale": "nb-NO",
          "name": "SEQUENCE"
        },
        {
          "locale": "nl-NL",
          "name": "VOLGORDE"
        },
        {
          "locale": "pl-PL",
          "name": "SEKWENCJA"
        },
        {
          "locale": "pt-BR",
          "name": "SEQUENCE"
        },
        {
          "locale": "pt-PT",
          "name": "SEQUÊNCIA"
        },
        {
          "locale": "ro-RO",
          "name": "SEQUENCE"
        },
        {
          "locale": "ru-RU",
          "name": "ПОСЛЕД"
        },
        {
          "locale": "sk-SK",
          "name": "SEQUENCE"
        },
        {
          "locale": "sl-SI",
          "name": "SEQUENCE"
        },
        {
          "locale": "sr-Latn-RS",
          "name": "SEKVENCE"
        },
        {
          "locale": "sv-SE",
          "name": "SEKVENS"
        },
        {
          "locale": "th-TH",
          "name": "SEQUENCE"
        },
        {
          "locale": "tr-TR",
          "name": "SIRALI"
        },
        {
          "locale": "uk-UA",
          "name": "SEQUENCE"
        },
        {
          "locale": "vi-VN",
          "name": "SEQUENCE"
        },
        {
          "locale": "zh-CN",
          "name": "SEQUENCE"
        },
        {
          "locale": "zh-HK",
          "name": "SEQUENCE"
        },
        {
          "locale": "zh-TW",
          "name": "SEQUENCE"
        }
      ],
      "signature": {
        "display": "SEQUENCE(rows, [columns], [start], [step])",
        "parameters": [
          {
            "description": null,
            "name": "rows",
            "optional": false,
            "repeats": false
          },
          {
            "description": null,
            "name": "columns",
            "optional": true,
            "repeats": false
          },
          {
            "description": null,
            "name": "start",
            "optional": true,
            "repeats": false
          },
          {
            "description": null,
            "name": "step",
            "optional": true,
            "repeats": false
          }
        ],
        "trailing_repeats": false
      },
      "surface_name": "SEQUENCE",
      "version_marker": null,
      "xlcall": null
    },
    "microsoft": "https://support.microsoft.com/en-us/office/sequence-function-57467a98-57e0-4817-9f14-2eb78519ca90"
  },
  "try_it": {
    "formula": "=SEQUENCE(2,3,10,2)"
  },
  "url": "https://handbook.dnacalc.com/functions/SEQUENCE.html",
  "variants": [],
  "versions": []
}