title: Excel : using VLOOKUP to aggregate several values
body: <p>I am doing quotations in Excel for my company and I am trying to find a way to do 2 things:</p>
  
  <ul>
  <li>aggregate several quantities of the same product based on its reference number</li>
  <li>return several values for the same references (i.e. different prices)</li>
  </ul>
  
  <p>I was thinking about using VLOOKUP but I cannot find a way to make it sum or return multiple values.</p>
  
  <p>Table outline in the picture attached <a href="https://i.stack.imgur.com/QF9h5.jpg" rel="nofollow noreferrer">here</a>, the wanted result would be:
  - for the 1st function: sum up the table into 3 lines with aggregated quantities for products X Y Z
  - for the 2nd function: sum up the table into 4 lines with the prices for products X Y Z (X having 2 different prices in the sample data, but I would need the function to be able to return as many lines as there are different prices for the same product)</p>
  
  <p><a href="https://i.stack.imgur.com/R6EYK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R6EYK.png" alt="enter image description here"></a></p>
  
  <p>Thank you very much for you help!</p>
  
  <p>Kind regards,
  Antoine</p>
  
  <p>Edit: to get a better idea of what I try to achieve, here is another picture:
  <a href="https://i.stack.imgur.com/x5oPB.jpg" rel="nofollow noreferrer">2nd pic with annotations</a>
  Quantities of the same product have to be aggregated, except if the unit price is different. 
  Could price difference be based on a subreference to be added to the first table? That would need the vlookup to match 2 values to return a result, is that feasible?
  Noting that I do not have control over the source data for unit price, meaning that reference and subreference would have to be in different columns rather than concatenated.</p>
  
  <p>The goal is to produce a recap table rather than filter out single values as suggested in the answer.</p>