Google-sheets – Have indirect update row when pasted on new rows

google sheets

According to this answer, I am fetching data from another sheet over rows:

https://webapps.stackexchange.com/a/24478/29203

The problem for me is as I am fetching over rows, the supplied answer does not work because if I copy the value fetching formula from B1 and past it into C1, D1 and so on, they all display the same values. Because the end of the cell reference is not updated. It's a string, so it wouldn't. Is there anyway to concatenate a "normal" cell reference into this mix, to make this work?

The code in question is

=indirect(A1&"!B2")

So, I am thinking I need to replace the last "!B2" with something that takes a normal cell reference (not string) and converts it into a string. I tried ADDRESS(), but could not get it to work.

Best Answer

This might be correct:

=INDIRECT(datasourcepoint!$A$1&"!A"&ROW(B2))

I am actually fetching the sheet name from another sheet (it just contains the name of the source data sheet to use). The trick was to add &ROW(B2) instead of 2" towards the end.