XLA routines: EE_BusinessDaysInDateRange
EE_BusinessDaysInDateRange takes 2 dates, and a holiday calendar, and returns the number of business days in the date range.
Function EE_BusinessDaysInDateRange(dt1 As Date, dt2 As Date, rngHolidays As range) 'Takes date 1, date 2 and works out the amount of business days between them '- takes range of holidays Dim intLoop As Date Dim intDaysCount As Integer 'http://excelexperts.com/xla-routines-eeBusinessDaysInDateRange for updates on this function For intLoop = dt1 To dt2 Step IIf(dt1 > dt2, -1, 1) If EE_IsBusinessDay(rngHolidays, intLoop) Then intDaysCount = intDaysCount + 1 End If Next intLoop EE_BusinessDaysInDateRange = intDaysCount End Function
»
- Nick's blog
- Login or register to post comments
- 2559 reads
Recent comments
5 years 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago