Dapatkan susunan daftar nomor urut
=SEQUENCE(rows, [columns], [start], [step])
| Parameter | Deskripsi |
|---|---|
rows |
Number of rows to return. |
columns |
[optional] Number of columns to return. |
start |
[optional] Starting value (defaults to 1). |
step |
[optional] Increment between each value (defaults to 1). |
The SEQUENCE function takes four arguments: rows, columns, start, and step. All values default to 1. The rows and columns arguments control the number
=SEQUENCE(5,1) // returns {1;2;3;4;5} in 5 rows
=SEQUENCE(1,5) // returns {1,2,3,4,5} in 5 columns
Note that the output from SEQUENCE is an array of values that will spill into adjacent cells. The formula below will create a 5 x 5 array that contain
=SEQUENCE(5,5) // numbers 1-25 in a 5 x 5 array
The syntax for SEQUENCE indicates that rows is required and columns is optional. However, either can be omitted:
=SEQUENCE(5) // returns {1;2;3;4;5} in 5 rows
=SEQUENCE(,5) // returns {1,2,3,4,5} in 5 columns
The start argument is the starting point in the numeric sequence, and step controls the increment between each value. Both formulas below use a start
=SEQUENCE(3,1,10,5) // returns {10;15;20} in 3 rows
=SEQUENCE(1,3,10,5) // returns {10,15,20} in 3 columns
In the example in the screen above, the formula in B4 is:
=SEQUENCE(10,5,0,3)
SEQUENCE can work with both positive and negative values. To count from -10 to zero in increments of 2 in rows, set rows to 6, columns to 1, start to
=SEQUENCE(6,1,-10,2) // returns {-10;-8;-6;-4;-2;0}