XLA routines: EE_SubtractBusinessDays
EE_SubtractBusinessDays takes a date, and a holiday calendar and subtracts a specified amount of business days.
Function EE_SubtractBusinessDays(dt As Date, rngHolidays As range, intBusinessDays As Integer) As Date 'Takes a date, a range of holidays, business days, and subtracts that amount of business days from the date. Dim intDays As Integer Dim intLoop As Integer Dim dtNew As Date 'http://excelexperts.com/xla-routines-eeSubtractBusinessDays for updates on this function If intBusinessDays = 0 Then EE_SubtractBusinessDays = dt Exit Function End If dtNew = dt intDays = Abs(intBusinessDays) For intLoop = 1 To intDays dtNew = EE_PrevBusinessDay(rngHolidays, dtNew) Next intLoop EE_SubtractBusinessDays = dtNew End Function
»
- Nick's blog
- Login or register to post comments
- 2757 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