title: MS Excel Payback Period Formula to Display Year / Compare Cumulative Totals in Separate Rows
body: <p>I am working on a project that is supposed to compare the cost of automation vs non-automated call analyzing and then tell you what year the payback period will be. I am having issues trying to get the formula right to just display the year when the cost of the automated system is less than the cost of the non-automated system. I have tried using LOOKUP, but can't seem to figure out the logic I guess to get it to display the right year. All formulas must us cell references.  Here is my data:</p>
  
  <pre><code>`First row:                 Year:   1    2    3    4    5    6     7`
  `Second row:  Cumulative Total 1: $15  $25  $55  $60  $75  $85  $100`
  `Third row:   Cumulative Total 2:  $5  $10  $15  $50  $80  $95  $200`
  `Fourth row: Payback Period Year:` 5
  </code></pre>
  
  <p>The top row displays a seven year analysis of the cost of two systems, automated, and non-automated. The second row is an example of total spent per year of the automated system, and the third row is the total spent on the non-automated system. These are cumulative totals. Once the total cost in the second row becomes less then the cost in the third row in the same year, then the cell in the fourth row after "Payback Period Year:" should display the correct year number from the top row. Any help with this would greatly be appreciated.</p>