Get current Row number inside ArrayFormula

前端 未结 2 650
温柔的废话
温柔的废话 2021-02-12 05:55

In a Google Docs Spreadsheet, I would expect this formula:

=ARRAYFORMULA(ROW())

to fill the column like:

[   1]
[   2]
[   3]
[   4]         


        
相关标签:
2条回答
  • 2021-02-12 06:28

    The following may be a little simpler:

    =arrayformula(ROW(INDIRECT("A"&ROW()&":A")))
    

    or

    =index(ROW(INDIRECT("A"&ROW()&":A")))
    
    0 讨论(0)
  • 2021-02-12 06:33

    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.

    0 讨论(0)
提交回复
热议问题