I'm working on a spreadsheet and could really use some help. I'm trying to populate cells in a main worksheet with cells from another worksheet within the spreadsheet.

Currently I'm planning on having a dropdown using data validation in A1 to select which sheet to view, and populate it based on what is selected.

In the populated sheets the code in A2 looks somewhat like this

=IF(REGEXMATCH(A1,"SheetA), SheetA!A2, IF(REGEXMATCH(A1,"SheetB"), SheetB!A2))

Currently this works flawlessly for the first if statement, but not for the second. My understanding was that the if function in google sheet was formated like this


Anyone care to help me out with this?

1 Answer 1


I got this to work, the above is correct - I simply fudged it with other old code etc. Will leave this here for future googlers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.