Search code examples
if-statementgoogle-sheetsnested-if

Using data from another sheet in a formula with sheet name in formula


I'm writing a finance spreadsheet with google sheets and it works fine, except that I have to manually rewrite every entry in the formula to use the correct sheet. Is there a way to insert a variable in the following formula to make it read the sheet name from another cell?

=abs(SUMIFS('Feb21'!$I:$I;'Feb21'!$L:$L;D$2))

In the above formula, Feb21 is the sheet name that I'd like to be referenced by another cell. I already tried indirect, but it just tells me that there's an error in the formula.


Solution

  • try INDIRECT:

    =ABS(SUMIFS(INDIRECT(A1&"!I:I"); INDIRECT(A1&"!L:L"); D$2))