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
- 2587 reads
Recent comments
5 years 41 weeks ago
6 years 27 weeks ago
6 years 39 weeks ago
6 years 42 weeks ago
6 years 43 weeks ago
6 years 48 weeks ago
7 years 4 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago
7 years 5 weeks ago