Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Array formula to fill a sequence of n numbers in a column

I have a Google sheet that has a sequence of numbers in the left column:

Sample Database

I’d like to write an array formula in A1 that automatically adds the next number in the sequence when a new row is added to the sheet.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

For example, if I add a row 8, an 7 (the next number in the sequence) automatically fills in cell A8. I’ve tried this with the Sequence function, but that requires a pre-defined number of rows. I’ve also tried to do an array formula that uses something like "A3=A2+1", but I can’t get the syntax to work in an array.

>Solution :

Try the following in cell A1:

={"Sequence";sequence(rows(A2:A))}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading