Home > Enterprise >  Formula for Auto Generating number in Google Spreadsheet
Formula for Auto Generating number in Google Spreadsheet

Time:11-10

I am trying to find the way of making a formula that will auto generate the "id" number like we do in mySql auto-generate.

If I explain more, it would be like (number of A1 1).

CodePudding user response:

You can try this formula,

=SUM((INDIRECT("A" & ROW() - 1)),1)

** Here A is the Column.

How it works:

  1. You have to put a number on a cell of A coulumn then the very next row of that A column you will put this Formula. Then you should get the number 1. Which will look like MySql auto generated id.

  2. Then you can just grab the blue dot/point of the cell which is lower right of the cell, and expand it to lower of the A column, and it will generate numbers like MySql auto generated id.

CodePudding user response:

use SEQUENCE:

=SEQUENCE(10)

bound to A column:

=SEQUENCE(COUNTA(A2:A))
  • Related