Search code examples
arraysif-statementgoogle-sheetsgoogle-sheets-formulaarray-formulas

New row in spreadsheet to add column using row ID number in Google Sheets


For every row thats added, I want to automatically add an ID column using the row number, ideally in another sheet as a new row.

I started using this TEXT(ROW()-1,"000"). This would output 001 for row 2 etc. Perfect.

You can edit this spreadsheet: https://docs.google.com/spreadsheets/d/1oAtDLo2Bk-3SaUAYX9GrscC6DN_h8lO8pqLUWPTAoJw/edit?usp=sharing


Solution

  • try:

    =ARRAYFORMULA(IF(B8:B="",,TEXT(ROW(A1:A), "000")))
    

    0