Search code examples
if-statementgoogle-sheetssplitflattentextjoin

Referencing another cell twice in a Google Sheet formula returned error


I want to check where - in a specified range - does a value exist in a Google Sheet. If I already know the column, I would use the "Match()" function to get the row number. But let's say if I still want to get a number for the column, and use the Match() function again, I wasn't able to. In the match function, I wanted to use a dynamic value like "Sheet1!E3" to specify the row I'm searching for, but it didn't work. Here is the sheet to illustrate the idea. Why is that? In a case like this, if I want to use the dynamic value twice - Sheet1!E3:Sheet1!E3, what should I do instead?

Thanks!

See the test sheet linked


Solution

  • delete E4. use in E3:

    =INDEX(FLATTEN(SPLIT(TEXTJOIN(, 1, IF(E2=A2:B17, ROW(A2:B17)&"​"&COLUMN(A2:B17), )), "​")))
    

    enter image description here