When deploying MSDN function for calculating working days, beside a problem with date formatting I found an issue with Holiday count.
Calculation is correct, but only if
without delving into your code, I'd suggest doing a count of holidays in your holiday table that fall on weekends and which also fall inside the range of days you are considering. Subtract that total from an (I presume) otherwise correctly calculated total and you should have the proper adjustment taking weekend holidays into account.