title: MySQL function to calculate next working day given a number of days including holidays (Excel's WORKDAY)
body: <p>Excel has the WORKDAY() function that calculates the next working day given a number of days including holidays.</p>
  <p>I've been trying to do an equivalent efficient function in MySQL but dealing with the exceptions was too much and I'm stuck with this. Have anybody found an efficient solution for this?</p>
  <h2>The Excel WORKDAY Function</h2>
  <pre><code>WORKDAY(start_date, day_count [,holiday_list])
  </code></pre>
  <p>This works like <code>start_date + INTERVAL day_count DAY</code> except that it only includes workdays.  Workdays are defined as non-weekend non-holiday days. Weekends here are Sa and Su.</p>
  <pre><code>WORKDAY.INTL(start_date,  day_count [,weekend [,holiday_list]])
  </code></pre>
  <p>Is the same except <code>weekend</code> is a code identifying which days of the week constitute the weekend.</p>