Copy cell from on sheet to another, if other cell in row matches values

copy, google-sheets, google-sheets-query

Solution

Please try:

=query('Sheet one'!A:D,"Select A where D='Yes' or D='Maybe'") 

Problem

What I want, is to copy a cell(s) from one sheet to another, only if another cell in the same row (different column) have/has a particular value(s) in Google Sheets. Ideally, I would like this to be live; if I add a row in the first sheet and the criterion matches, the second sheet will update too. Here's an example: ``` Sheet one Column A | Column(s)… | Column D ================================= Hello | | Yes World! | | Yes Foo | | Maybe Bar | | Sheet two Column A | Column(s)… | Column D ================================= Hello | | World! | | Foo | | | | ``` So in this example, my criteria is that if the row's cell in `Column D` equals either `Yes` or `Maybe`, that row's cell in `Column A` is copied into the second sheet.

Original source