title: Excel - Return multiple matching values from a column matching two variables, horizontally in one row
body: <p>I have this table:</p>
  
  <pre><code>|   | A       | B      | C |
  |---|---------|--------|---|
  | 1 |         |        |   |
  | 2 | Oranges | Red    | 1 |
  | 3 | Apples  | Yellow | 2 |
  | 4 | Grapes  | Orange | 3 |
  | 5 | Oranges | Orange | 4 |
  | 6 | Apples  | Red    | 5 |
  | 7 | Grapes  | Green  | 6 |
  | 8 | Apples  | Green  | 7 |
  </code></pre>
  
  <p>I want to check for matching values in Column A like <strong>Apples,Yellow</strong> , <strong>Apples,Green</strong>, etc... and return all the corresponding values from <code>Column B</code> in one row:</p>
  
  <p>I tried to nest AND into IF but didn't work out as it wasn't returning any values at all.</p>
  
  <pre><code>|    | A       | B           | C | D | E |
  |----|---------|-------------|---|---|---|
  | 11 | Apples  | Green       | 1 |   |   |
  | 12 | Oranges | YellowGreen | 2 |   |   |
  </code></pre>
  
  <h3>My code:</h3>
  
  <pre><code>=INDEX($B$2:$B$8, SMALL(IF($A$11=$A$2:$A$8, ROW($A$2:$A$8)-ROW($A$2)+1), COLUMN(A1)))
  </code></pre>
  
  <p>How do I get this formula to look at two variables to match?</p>
  
  <p>Thank you.</p>