title: Excel - Formula to create an array of lookup values based on a criteria
body: <p>I was looking for the solution for this apparently easy problem, but failed so far. I have a table in Excel like this: </p>
  
  <pre><code>Column 1   Column 2
  apples        1
  apples        2
  bananas       5
  apples        3
  bananas       4
  </code></pre>
  
  <p>What I need is a formula that returns an array of the values in column 2, based on the criteria on column 1. So if I choose "apples", my output array should be {1,2,3}. That output should be compatible for use inside of a standard SUM(SUMIFS()) formula.</p>
  
  <p>Thanks in advance for any insight</p>
  
  <p>Regards,
  André</p>
  
  <p>Edit: The order of the elements in the output array is unimportant</p>