Google-sheets – Command to search the column for a value, and then tell sheets to print the associated row

google sheets

I'm making a list of all the items I own. I want to place all the items in a list on a single sheet. Each Item will have a "category code" attached to it. I would like additional sheets to:

  1. Look through the master list for a specific category code.
  2. Then, when it finds a matching code to copy the entire row over to the new sheet.

What command do you use to search the column for a value, and then tell sheets to print the associated row?

Best Answer

I have very little information to work on. I'm assuming you have the "category code" in a different column for the row entry. "Addition sheet" means you want it in different tab of same spreadsheets. You can use this code in your cell from where you want to start printing the rows

=Query('<Sheet name>'!<Column Range>,"Select * Where <column> = '<category code value>'")

Suppose Sheet name is Sheet1, Column range is A2:Z, column with category code is B and category code you're looking for is "Medicines".

=Query('Sheet1'!A2:Z,"Select * Where B = 'Medicines'")