Search code examples
google-sheetsmatchvlookupgoogle-formsgoogle-query-language

If or query, if criteria is met, copy from other sheet


I think, what I am trying to do is pretty simply. But I cant seem to get it right.

I have 2 taps In one sheet.

Sheet 1 is an Overview of Sheet 2.

In Sheet 1 I have in column A the status for each pallet. In Sheet 2, I have the overview of the content of each pallet.

Now I just want to select once, the status (if Sold or Available) in Sheet 1 and it now automatically copies the status to Sheet 2, where the criteria of the pallet name is met.

EG: P-0011 is marked as sold in Sheet 1 - In Sheet 2 all rows who contain P-0011 will automatically copy the status to the cell.

I have tried

=if('Recap Pallets'!C:C,B2,'Recap Pallets'!A:A)

But it's not working.

I have also tried

=query('Recap Pallets'!A:C,"Select A where A='Sold' or A='Available'")

but also this seems wrong, because it just copies the row, and not the content regarding to the matching criteria.

What is the mistake?

Please see here example:

SHEET


Solution

  • delete everything in A column and use this in A1:

    ={"Status"; INDEX(IFNA(VLOOKUP(B2:B, {'Recap Pallets'!C:C, 'Recap Pallets'!A:A}, 2, 0)))}
    

    enter image description here