3

I would like to copy and paste data from cells in columns A:D in sheet 1, onto sheet 2 only if the cells in Column F = yes

I have tried to write the formula, but I keep getting parse errors. The formula I have tried to use is

=query("Sheet1"!A:D,"Select A where F="Yes"")
ZygD
  • 22,092
  • 39
  • 79
  • 102
Jason
  • 33
  • 1
  • 3
  • 1
    i am not asking anyone to do my work for me. i have tried to write the formula and keep getting Parse errors.. the formula i have tried to use is =query("Sheet1"!A:D,"Select A where F="Yes"") – Jason Mar 28 '18 at 14:04
  • column F is also on sheet 1, so i only want to paste over to "sheet 2" cells A:D if "sheet 1F" = "yes" – Jason Mar 28 '18 at 14:40

1 Answers1

6

I think your code was not working, because you did not include F in your data range, when you first defined it. And also the double quotes problem around Yes - there should be single quotes. This works for me:

=query(Sheet1!A:F,"Select A Where F='Yes'")

In case you want to return 4 columns:

=query(Sheet1!A:F,"Select A, B, C, D Where F='Yes'")

Also worth noting - the string search in the where clause of the query function works only if in the column you have more strings than any of the other formats.

ZygD
  • 22,092
  • 39
  • 79
  • 102