title: How do I conditionally sum cells in excel?
body: <p>Here is a table that I'm working with (an ascii art representation fo it):</p>
  
  <pre><code>|---|---------|-----------|--
  |   |A        |B          |
  |---|---------------------|--
  |1  |price    |override   |
  |---|---------|-----------|--
  |2  |10       |           |
  |---|---------|-----------|--
  |3  |20       |100        |
  |---|---------|-----------|--
  |4  |30       |           |
  |---|---------|-----------|--
  |5  |40       |90         |
  |---|---------|-----------|--
  |6  |50       |           |
  |---|---------|-----------|--
  |7  |150      |280        | &lt;-- SUMS
  |---|---------|-----------|--
  |   |         |           |
  </code></pre>
  
  <p>column A has some prices, column B has an override price, if any.
  Rows 1 to 6 have the prices, and row 7 has sums.</p>
  
  <p>Row 7 is calculated as "=SUM(A1:A7)"</p>
  
  <p>I want to write a formula for cell B7 that will do the following:  </p>
  
  <pre><code>for every cell in range A1:A7
      if the override field for that price is blank
          add the original price to the total
      else
          add the override price to the total
  </code></pre>
  
  <p><strong>My question: what formula will do the above?</strong></p>
  
  <p>I've looked at IF (cant figure out how to apply it on a range) and SUMIF(can't figure out how to get the "current cell" and "relative cell"), but I can't think of a way to do this. I'm a total novice at excel formulae.</p>