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
- 2659 reads
Recent comments
5 years 51 weeks ago
6 years 37 weeks ago
6 years 49 weeks ago
6 years 51 weeks ago
7 years 5 days ago
7 years 6 weeks ago
7 years 14 weeks ago
7 years 14 weeks ago
7 years 15 weeks ago
7 years 15 weeks ago