Google-sheets – way to copy text from two cells into another spreadsheet only if another cell has a YES

google sheets

I want to copy the text in Cells A1 and B1 into another spreadsheet that will be emailed out, but only if the text in Cell E1 has a "YES" in it.

How would I go about doing something like this in Google Sheets?

Best Answer

Is there a way to copy text from two cells into another spreadsheet only if another cell has a YES?

Yes, assuming A1 and A2 are in Sheet1 and your YES is in Sheet2 the following code will import the information into Sheet2:

=if(E1="YES",Sheet1!A1&Sheet2!A2,"")