Lets say I have a named range of dates that are holidays. This range is called 'holidays'. Is there a formula in Excel I could use to count the number of holidays that fall between 2 dates?
e.g. holidays = 7/3/2011, date 1 = 7/1/2011, date 2 = 7/7/2011: this formula calculates 1.
Edit: it seems the function =NETWORKDAYS gets me part of the way there, but as Excellll points out it only works if the holidays fall on weekdays.
Assuming you also have ranges named "date1" and "date2" this will work. It's inclusive, e.g., it will count New Years Day if date1 = 1/1/11. Remove the "="s if you don't want that.
=SUMPRODUCT((holidays>=date1)*(holidays<=date2))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With