Search code examples
arraysgoogle-sheetsmatchrowspreadsheet

How do I pass the value of Row() into the ArrayFormula function in Google Sheets?


I want to always have the current Row number in this formula:

=ArrayFormula(IFNA(match(2,1/(A5:5<>""))))

The ROW() function works for getting the current row number. How can I implement it into this ArrayFormula() like this? I imagine it working like this but it doesn't:

=ArrayFormula(IFNA(match(2,1/(A&ROW():ROW()<>""))))

How do I pass the value of Row() into the ArrayFormula() function?


Solution

  • this is not an arrayformula issue...

    constructed range always needs to be INDIRECTed:

    =ARRAYFORMULA(IFNA(MATCH(2, 1/(INDIRECT("A"&ROW()&":"&ROW())<>""))))