Function NumHols(StartDate As Date,EndData As Date, rngHolidays As Range) As Long
'rngHolidays must be a 1 column or 1 row range
NumHols = Application.Countif(rngHolidays,">=" & CLng(StartDate)) - Application.Countif(rngHolidays,">" & CLng(EndDate))
End Function
Come to think of it, if in VBA easiest to use Andrew's formula:
Code:Function NumHols(StartDate As Date,EndData As Date, rngHolidays As Range) As Long 'rngHolidays must be a 1 column or 1 row range NumHols = Application.Countif(rngHolidays,">=" & CLng(StartDate)) - Application.Countif(rngHolidays,">" & CLng(EndDate)) End Function