title: Excel - Return multiple matching values from a column, horizontally in one row
body: <p>I have an excel formula, which is supposed to work but returns #VALUE and I cannot figure out why.</p>
  
  <p>I have this table:</p>
  
  <pre><code>       A        B
  1 |          |     |
  2 | Oranges  |  1  |
  3 | Apples   |  2  |
  4 | Grapes   |  3  |
  5 | Oranges  |  4  |
  6 | Apples   |  5  |
  7 | Grapes   |  6  |
  8 | Apples   |  7  |
  </code></pre>
  
  <p>I want to Check for matching values in Column A like "Apples", "Oranges", etc. and return all the corresponding values from Column B in one row:</p>
  
  <p>The output should be like this but I only get #VALUE:</p>
  
  <pre><code>       A         B     C     D  
  11 | Apples   |  2  |  5  |  7  |
  12 | Oranges  |  1  |  4  | #NUM|
  </code></pre>
  
  <p>This is the formula:</p>
  
  <blockquote>
    <p>=INDEX($B$2:$B$8, SMALL(IF($A$11=$A$2:$A$8, ROW($A$2:$A$8)-ROW($A$2)+1), COLUMN(A1)))</p>
  </blockquote>