How to Add Row Numbers to a Workbook Sheet

Goal

Add a column with row numbers to a workbook sheet.

Learn

Please take note that the following approach will force the processing of a worksheet to occur in a single reducer. This is the only way to ensure that the row numbers are consistent. This may have a significant negative performance impact when generating the results.

Step-by-step guide 

  1. Create a new sheet in the workbook.
  2. In the first column, add the function GROUPBY(1)
  3. In the second column, add the function GROUPROWNUMBER()
  4. Add any desired columns after these first two columns have been established.