Home > Software design >  If or query, if criteria is met, copy from other sheet
If or query, if criteria is met, copy from other sheet

Time:03-04

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:

enter image description here

CodePudding user response:

Here's a quick and dirty solution:

=iferror(INDEX('Pallets Total'!A:A,MATCH(C3,'Pallets Total'!B:B,0)),"")

There's certainly more elegant ways, but this may work for the time being.

  • Related