# Return rows based on column value

1. ## Return rows based on column value

HI Friends! I am looking for a simple formula that will pull all the information from a row based on the cell value in one of the columns. See the attached file for reference. I would like to return all the information from the sheet "Showroom Floor" into the sheet "Results". Essentially, if i select an option from the list (Cell D3 in sheet "Results") all of the rows and their information from sheet "Showroom Floor" will appear in the appropriate columns of sheet "Results". To further explain, if "Cabinetry" was selected in D3 of sheet "Results" then the chart below that cell would return the information of from rows 6, 8, 13, 27 of sheet "Showroom Floor". I think it has to do with the Index formula but i can't seem to figure it out. Any help, thank you!

2. ## Re: Return rows based on column value

Hi,

Personally I'd use a Pivot Table and a Slicer to select the Item. See attached.

Otherwise I'd use the standard Data Filtering functionality to extract the relevbant records to your Results sheet.

3. ## Re: Return rows based on column value

The simplest way is with a helper column in Showroom Floor sheet. This column can be hidden after you create the formula if you wish. In M3 copied down
=IF(B3<>"",B3&"-"&COUNTIF(\$B\$3:\$B3,B3),"")

Then in Results in D6 copied down and across
Formula:
`Please Login or Register  to view this content.`

Is that what you are looking for?

4. ## Re: Return rows based on column value

I reverse my decision and agree with Richard, the simplest way is with a pivot table.

5. ## Re: Return rows based on column value

Thanks ChemistB! I believe this is exactly what I was looking for. Is there a way to change the formula slightly to give any empty cells a "-" instead of a "0" or "N/A"? The formula already accounts for the "N/A" I believe with "Iferror".

To take this formula further and more in depth, is it possible to select from two columns? Such as, can the list in cell D3 on "Results" contain values from columns "Items" & "Brand" from sheet "Showroom Floor" resulting in the same output?

6. ## Re: Return rows based on column value

Perhaps a more fundamental question is can there be more than one "Item" for any one "Brand"?

The sample data supplied indicates not.

You could however just add a Brand Slicer to the aforementioned Pivot Table, (or indeed a Slicer for any of the fields) and obtain the same results using the Brand Slicer.

There are currently 1 users browsing this thread. (0 members and 1 guests)