title: SUM and SUBTRACT if criteria is matched on the same formula on Google Spreadsheets
body: <p>I would like some help on how to SUM numbers of a column only if some criteria is matched and SUBTRACT from the first SUM only if some other criteria is matched?</p>
  
  <p>Looking at the screenshot below. Iam basically looking for a formula to give me the balance for each metal.</p>
  
  <p><a href="https://i.stack.imgur.com/LvI3U.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LvI3U.jpg" alt="enter image description here"></a></p>