Search code examples
google-sheetsfiltergoogle-sheets-formulagoogle-sheets-querygoogle-query-language

Get values from other sheet based on other cell values


How to get values from another sheet if another cell empty. I'm trying to get values from sheet1 column B if in sheet1 column H empty.

I mean if Sheet1 column B2 to B4 have values and in Column H on the same sheet, if H2 and H3 have text only B4 value print.

Sheet1 Image

enter image description here

Sheet2 Image

enter image description here

Here is what I try to do that not work

=query(Sheet1!B2:B, "Select Sheet1!b where Sheet1!H <> ''")

Solution

  • try:

    =FILTER(Sheet1!B2:B, Sheet1!B2:B<>"", Sheet1!C2:C="")
    

    or:

    =QUERY(Sheet1!B2:C, "select B where B is not null and C is null", 0)
    

    or:

    =QUERY(Sheet1!B2:C, "select B where B !='' and C =''", 0)