Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save drhisham-code/e90a680bc44faf6b247f54ada38a4333 to your computer and use it in GitHub Desktop.
Save drhisham-code/e90a680bc44faf6b247f54ada38a4333 to your computer and use it in GitHub Desktop.
auto increment column with header row in google sheets
= ArrayFormula(
IF(ROW(B:B)=1,"ID",
IF(ISBLANK(B:B),"",
row(B:B)-1
)
)
)
// A:A is the ID column that will autoincrement
// B:B is the adjacent column that is checked for blank
// LINE 4 is the main function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment