title: Calculate sum as per record type
body: <p>Here is my sample excel file data</p>
  
  <p><img src="https://i.stack.imgur.com/w9WyM.png" alt="enter image description here"></p>
  
  <p>How can I calculate sum of all <code>CR</code> and <code>DR</code> type records separately?
  Result should be</p>
  
  <p><strong>Total Debit = XXX
  Total Credit = XXX</strong></p>
  
  <p><code>Logic somthing like...</code></p>
  
  <pre><code>Dim debit;
  for each row in sheet1
      if(data of C column == dr)
          debit = debit + data of D column
      end if
  end for
  print debit; 
  </code></pre>
  
  <p>I am not very much familiar with Excel 2010 so not sure how to code this so please give me some basic steps also to achieve this.</p>