SEQUENCE function

SEQUENCE generates arrays of sequential numbers based on row/column counts, starting value, and step increment.

=SEQUENCE(rows, [columns], [start], [step])

Generate a SEQUENCE formula

Describe what you need. The generator will reach for SEQUENCE where SEQUENCE is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How SEQUENCE reads its arguments
rowsrequiredcolumnsoptionalstartoptionalstepoptionalSEQUENCE
ArgumentRequiredDescription
rowsRequiredNumber of rows in the output array. Required; must be a positive integer. If rows is 0 or negative, returns #VALUE!.
columnsOptionalNumber of columns in the output array. Optional; defaults to 1 if omitted, creating a single-column array. If 0 or negative, returns #VALUE!.
startOptionalFirst number in the sequence. Optional; defaults to 1 if omitted. Can be any number (positive, negative, or decimal).
stepOptionalIncrement between consecutive numbers. Optional; defaults to 1 if omitted. Cannot be 0 (returns #NUM!). Use negative values to count down.

Returns

An array of sequential integers with dimensions specified by rows and columns parameters.

Availability

Excel: 365 / 2021+ · Google Sheets: Supported

Worked examples

1. Create unique inventory IDs for each ingredient

IngredientSupplierUnitQtyExpiry
FlourMiller'skg252026-12-15
Tomato SauceRedBrandL122026-10-20
Olive OilPureOilL82027-03-10
BasilFresh Herbs Cobunch302026-09-22
MozzarellaDairyFreshkg152026-09-25
=SEQUENCE(COUNTA(A2:A6))

Result: [[1],[2],[3],[4],[5]]

COUNTA counts the 5 ingredient rows (A2:A6), and SEQUENCE generates one ID per ingredient, starting at 1 with a step of 1. The result is a 5×1 array of sequential reference numbers for inventory tracking.

2. Build a 5-week stock forecast table

IngredientWeek 1Week 2Week 3Week 4Week 5
Flour
Tomato Sauce
Olive Oil
Basil
Mozzarella
=SEQUENCE(5,5)

Result: [[1,2,3,4,5],[6,7,8,9,10],[11,12,13,14,15],[16,17,18,19,20],[21,22,23,24,25]]

SEQUENCE creates a 5×5 grid where each row represents an ingredient and columns represent forecast weeks. The sequential numbers (1–25) can serve as unique transaction IDs, forecast period codes, or placeholder multipliers for usage calculations across the planning horizon.

3. Generate reorder quantity thresholds

SupplierSmallMediumLargeBulkMega
Miller's5075100125150
RedBrand5075100125150
PureOil5075100125150
=SEQUENCE(5,1,50,25)

Result: [[50],[75],[100],[125],[150]]

SEQUENCE starts at 50 and increments by 25 for each tier, generating 5 reorder quantity levels. These thresholds (50, 75, 100, 125, 150 units) represent pricing brackets for suppliers, enabling automatic tier-based cost calculations for ingredient restocking.

Common errors

Which SEQUENCE error are you seeing?
SEQUENCE returned an error#VALUE!
Ensure rows is a positive integer (e.g., 5, not -5 or 0). Check if a COUNTA or similar formula is returning 0; verify it references the correct range.
#NUM!
Provide a non-zero step value. Use 1 for ascending, -1 for descending, 0.5 for decimal increments, or any other non-zero number.
#SPILL!
Clear cells to the right and below the formula to make room, or reduce the rows and columns parameters to fit the available space.
ErrorWhy it happensHow to fix it
#VALUE!The rows parameter is zero, negative, or non-numeric; or the columns parameter is negative or non-numeric.Ensure rows is a positive integer (e.g., 5, not -5 or 0). Check if a COUNTA or similar formula is returning 0; verify it references the correct range.
#NUM!The step parameter is exactly 0, which would create an infinite sequence with no numeric progression.Provide a non-zero step value. Use 1 for ascending, -1 for descending, 0.5 for decimal increments, or any other non-zero number.
#SPILL!In Excel, the array result is too large to fit in available cells, or adjacent cells contain data that blocks the spill range.Clear cells to the right and below the formula to make room, or reduce the rows and columns parameters to fit the available space.

Tips and when to use something else

  • Use SEQUENCE to generate row numbers, ID codes, or date sequences for use with INDEX, XLOOKUP, or multiplication formulas, avoiding manual data entry.
  • Combine SEQUENCE with TRANSPOSE to flip output orientation: =TRANSPOSE(SEQUENCE(1,6)) creates a row of 6 numbers instead of a column.
  • Create countdown sequences by using a negative step: =SEQUENCE(5,1,100,-10) generates 100, 90, 80, 70, 60 for ranked lists and reverse sorting.
  • For non-numeric sequences, conditional generation, or data-dependent patterns, use LAMBDA or MAP functions instead of SEQUENCE.

Frequently asked questions

Can SEQUENCE generate decimal numbers?
Yes. Use decimal values for start and step: SEQUENCE(4,1,0.5,0.5) returns 0.5, 1, 1.5, 2. This works for fractional sequences like pricing tiers or ratio calculations.
How do I create a descending sequence with SEQUENCE?
Use a negative step value: SEQUENCE(5,1,100,-1) counts down from 100 to 96. The step parameter controls both the direction and magnitude of change between numbers.
Does SEQUENCE work in both Excel and Google Sheets?
Yes, SEQUENCE is available in Excel 365/2021+ and Google Sheets with identical syntax. Older versions and Excel 2019 and earlier do not support SEQUENCE.
When should I use SEQUENCE instead of typing numbers manually?
Use SEQUENCE for any sequence longer than a few items, especially when length depends on other data. This ensures sequences update automatically when your data changes.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17