Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Formula to count the number of holidays between 2 dates in excel

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.

like image 850
Zach Avatar asked Nov 17 '25 09:11

Zach


1 Answers

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))
like image 59
Doug Glancy Avatar answered Nov 20 '25 18:11

Doug Glancy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!