In a Google Docs Spreadsheet, I would expect this formula:
=ARRAYFORMULA(ROW())
to fill the column like:
[ 1] [ 2] [ 3] [ 4] ...
but instead it stops at 1. What is happening here? Is there another way to get the current row number in an arrayformula?
The ROW function in Google Sheets returns the row number of a given cell. For example, if you want to know what row number the cell A1 is in, you would use the function =ROW(A1). This function is especially useful when you're working with formulas and need to refer to specific rows or columns.
The ROW function returns the row number for a cell or range. For example, =ROW(C3) returns 3, since C3 is the third row in the spreadsheet. When no reference is provided, ROW returns the row number of the cell which contains the formula.
However, as we mentioned before, ARRAYFORMULA can be used with non-array functions, for example, IF, SUMIF, COUNTIF, VLOOKUP, and others.
Pressing Ctrl+Shift+Enter while editing a formula will automatically add ARRAYFORMULA( to the beginning of the formula.
You need to specify a cell-range argument for ROW() in order to have more than one value.
Try it this way:
=ARRAYFORMULA(ROW(A1:A10))
This will fill a column with row numbers from 1 to 10.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With