title: Calculating exact fraction of months during period
body: <p>I have a list of periods (given by period start, period end) in Excel and I have to calculate exactly how many months (as a fraction) are during that period. </p>
  
  <p>E.g. if given a period January 15th to March 7th, then this would be </p>
  
  <pre><code>15-01-2015 until 31-01-2015 = 17 days
  01-02-2015 until 28-02-2015 = 28 days
  01-03-2015 until 07-03-2015 =  7 days
  </code></pre>
  
  <p>Months during period = 17/31 + 28/28 + 7/31 = 1,774193548 months</p>
  
  <p>Note that in this calculation, start date <em>and</em> end date are both counted as part of the period.</p>
  
  <p>As the periods can be anything, then I haven't been able to figure out to calculate this with an Excel formula (or if it's even possible).</p>
  
  <p>Any ideas?</p>