1
votes

I have two Google spreadsheets. Three columns on the second spreadsheet are being imported through the IMPORTRANGE() formula. It looks like this:

Spreadsheet 1

╔════════╦════════╦════════╦════════╗
║ title1 ║ title2 ║ title3 ║ title4 ║
╠════════╬════════╬════════╬════════╣
║ input1 ║ input4 ║ input7 ║        ║
║ input2 ║ input5 ║ input8 ║        ║
║ input3 ║ input6 ║ input9 ║        ║
╚════════╩════════╩════════╩════════╝

Spreadsheet 2

╔════════╦════════╦════════╗
║ title1 ║ title2 ║ title3 ║
╠════════╬════════╬════════╣
║ input1 ║ input4 ║ input7 ║
║ input2 ║ input5 ║ input8 ║
║ input3 ║ input6 ║ input9 ║
╚════════╩════════╩════════╝

The thing is, I only want the data to be imported if the corresponding cell in the title4 column is populated. Like this:

If Spreadsheet 1 looks like this

╔════════╦════════╦════════╦═════════╗
║ title1 ║ title2 ║ title3 ║ title4  ║
╠════════╬════════╬════════╬═════════╣
║ input1 ║ input4 ║ input7 ║         ║
║ input2 ║ input5 ║ input8 ║ input11 ║
║ input3 ║ input6 ║ input9 ║         ║
╚════════╩════════╩════════╩═════════╝

then Spreadsheet 2 should look like this

╔════════╦════════╦════════╗
║ title1 ║ title2 ║ title3 ║
╠════════╬════════╬════════╣
║ input2 ║ input5 ║ input8 ║
╚════════╩════════╩════════╝
1

1 Answers

0
votes

I figured this out.

I used the argument:

=IF("Sheet Title 1!F1:F1000"<>"", IMPORTRANGE("Spreadsheet Key","Sheet Title 1!E1:E1000"), "")

So the contents of Column E in the first sheet are only copied to the second sheet if the cell in the same row in Column F is not empty.