title: How do I check for duplicate rows and do calculate on that rows in excel file?
body: <p>I have one excel file which is having data like following</p>
  <pre><code>CUSIP   Quantity  Date           Price
  AF0      500000   5/6/2013      1
  AE4      400000   5/6/2013      1.0825
  AE4      500      5/6/2013      1
  </code></pre>
  <p>I need to check for column <code>CUSIP</code> and <code>Date</code>
  If I'm having duplicate <code>CUSIP</code> for same <code>date</code> then I need to do following calculation.</p>
  <blockquote>
  <p>1.Need to add <code>Quantity</code> for both of them instead of showing duplicate records need to show only one record( sum of Quantity).</p>
  <p>2.Need to do calculation on Price as well like following</p>
  </blockquote>
  <pre><code>NewPrice = ((400000 * 1.0825) + (500 * 1.00))/(400000 + 500) = 1.08148
  </code></pre>
  <p>For example in using above data
  Need to show output like</p>
  <pre><code>CUSIP   Quantity  Date          Price
  AF0     500000    5/6/2013      1
  AE4     400500    5/6/2013      1.082397004
  
     
  </code></pre>
  <p>How do I achieve this in excel file using LOOKUP or else ?</p>