SEQUENCE

generates a sequence of numbers as an array · from excel · excel: verified match · sheets: verified match

signature

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

returns: array

argumentrequired
rows required
columns optional · defaults to 1
start optional · defaults to 1
step optional · defaults to 1

examples

formula and result, taken from the engine's own test suite — every result below is asserted in CI, not written by hand.

fx =SEQUENCE(5) 1
fx =SEQUENCE(2, 3, 10, 10) 10

errors

error values observed from the engine — each with a call that produces it.

errorproduced by
#ERROR! =SEQUENCE(1000,1001)
#CALC! =SEQUENCE(0)
#VALUE! =SEQUENCE(1,16385)

related

  • ARRAY_CONSTRAIN truncates a range to at most the given rows and columns
  • ARRAYFORMULA evaluates an expression across a range (this engine already spills, so it is a pass-through for sheets compatibility)
  • ARRAYTOTEXT converts array to text representation
  • BYCOL applies lambda to each column of array
  • BYROW applies lambda to each row of array
  • CHOOSECOLS returns the specified columns from an array