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

=IF(WHAT_TO_CHECK, DO IF TRUE, DO IF FALSE)

Anyone care to help me out with this?

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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