How can I calculate a date within a certain amount of days, counting / not counting weekends into the calculation??

How can I calculate a date within a certain amount of days, counting / not counting weekends into the calculation??

Hi, I need to develop a way to calculate a new date from a start date, a number of days (before or after said date), excluding holidays I have in a database (as dates), and make two variations; one that includes weekends for the final date (counts but cannot land in a weekend) and another one that doesn't include weekends (doesn't count and cannot land in a weekend)

Thanks.