Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get current Row number inside ArrayFormula

Tags:

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?

like image 231
rymo Avatar asked Feb 23 '12 03:02

rymo


People also ask

How do I find the current row number in Google Sheets?

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.

How do I find the row number in an array in Excel?

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.

Does Sumifs work with Arrayformula?

However, as we mentioned before, ARRAYFORMULA can be used with non-array functions, for example, IF, SUMIF, COUNTIF, VLOOKUP, and others.

How do I use Arrayformula in Google Sheets?

Pressing Ctrl+Shift+Enter while editing a formula will automatically add ARRAYFORMULA( to the beginning of the formula.


1 Answers

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.

like image 114
Warwick Avatar answered Oct 25 '22 11:10

Warwick