Home > OS >  Fills the cells below with a number sequence by filling only first cell
Fills the cells below with a number sequence by filling only first cell

Time:09-27

How to fill cells below each other with a number sequence, filling only the first cell with a number, how many cells to fill?
In other words - Fill the first cell with a number to return an array of counted numbers.


Example 01
If I enter number 3 to A1
Result:
A1: 3
A2: 2
A3: 1

Example 02
If I enter number 5 to A1
Result:
A1: 5
A2: 4
A3: 3
A4: 2
A5: 1

Example 03
If I enter number 100 to A1
Result:
A1: 100
...
A100: 1

What I tried.

01.
I looked at the ArrayFormula() function, but I didn't know how to use it for this purpose or I don't know if it is even possible to use it for this purpose.
This is not the required solution.
02.
Pulling the edge is not suitable.

CodePudding user response:

Try this in cell A2:

=sequence(A1-1,1,A1-1,-1)
  • Related