title: Tiered Discount Price calculation Google Sheets formula
body: <p>I'm trying to figure out how to calculate a pricing subtotal based on tiered discount.
  I found various examples online for Excel but was not able to grok it and make it work in Google Sheets.</p>
  
  <p>What I'm trying to do is calculate the subtotal for 2 line items based on the green and yellow discount tables:</p>
  
  <p><img src="https://i.stack.imgur.com/nRlHH.jpg" alt="Image of my sheet"></p>
  
  <p>This would be a correct calculation for 40 site licenses:</p>
  
  <p>20 * 150 + 10 * 120 + 10 * 90 = 5100</p>