Returning list of column headers if a value in column A is detected

Nitrousoxide

New Member
Joined
Feb 27, 2018
Messages
2
I have a list of chemicals and ingredients in a chart and want to pull in a list of ingredients needed if I enter a the name of a chemical in column A into a cell.

Chemical BChemical AIngredient 1Ingredient 2Ingredient 3Ingredient 4
Chemical A111
Chemical B11
Chemical C11

<colgroup><col style="width: 100px"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"></colgroup><tbody>
</tbody>
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
Here's the table

And then here's the format of the user would enter the chemical in and in the third column how I'd like it to output the value.

Chemical WantedAmount WantedChemicals Needed
Chemical AIngredient 2
Ingredient 3
Ingredient 4

<colgroup><col width="131"><col width="120"><col width="171"></colgroup><tbody>
</tbody>
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>

Is there a way to get it to pull the list of ingredients if someone enters a chemical desired into first cell under "chemical wanted" based on the first table?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Try:

Excel 2012
ABCDEFG
1Chemical BChemical AIngredient 1Ingredient 2Ingredient 3Ingredient 4
2Chemical A111
3Chemical B11
4Chemical C11
5
6
7
8Chemical WantedAmount NeededChemicals Needed
9Chemical AIngredient 2Ingredient 3Ingredient 4

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet12

Array Formulas
CellFormula
C9{=IFERROR(INDEX($D$1:$G$1,SMALL(IF(INDEX($D$2:$G$4,MATCH($A9,$A$2:$A$4),0)=1,COLUMN($D$1:$G$1)-COLUMN($D$1)+1),COLUMNS($C9:C9))),"")}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



Put the array formula in C9, confirm with Control+Shift+Enter, and drag right as needed. Change the ranges to match your sheet.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,861
Members
449,052
Latest member
Fuddy_Duddy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top