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
- 2550 reads
Recent comments
5 years 34 weeks ago
6 years 20 weeks ago
6 years 32 weeks ago
6 years 35 weeks ago
6 years 36 weeks ago
6 years 42 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago