title: Excel formula to calculate YTD metrics by detecting current month
body: <p>I have two excel tables - 2015 sales and 2014 sales in the following format. And a third table called Year over Year Variance which looks at % change in 2015 over 2014.</p>
  
  <pre><code>2015          Jan     Feb    Mar .... YTD (total)
  Orders
  Revenue
  ...
  ...
  
  2014          Jan     Feb    Mar .... YTD (total)
  Orders
  Revenue
  ...
  ...
  
  Variance      Jan     Feb    Mar .... YTD
  Orders
  Revenue
  ...
  ...
  </code></pre>
  
  <p>Computing Jan variance over Jan or Feb variance over Feb is simple. How do I compute Year to date variance. Because the 2014 table is already populated for the whole year - so the last column is the sum of 12 months of data.</p>
  
  <p>For 2015, I only have Jan and Feb. So the variance column for Year to date should be (Jan+Feb 2015)/(Jan+Feb 2014). How do I write a formula to check for the current month and then sum only those two months for the year to date calculation?</p>