Forumula help - Calculate number of days that one timeline column overlaps with another timeline column

I have a team calendar board for tracking PTO/company holidays, which has a formula counting the number of Total Days (minus weekends) for each entry. I’m also working on a sprint capacity planner board and plan to pull in the pto and company holidays from from a connection and mirror (total days) so that I can deduct from each team member’s expected capacity. The challenge I have is that the pto/holiday tracker entries do not all align with the 2-week sprint cycles (Wed-Tues) so the mirror column dates are going to throw off the calculations. I would like to create a formula that looks the timeline column in the Sprint Capacity Planner board and the mirror column from the Calendar board and calculates the number of days that those two overlap. Then I can create another formula that deducts the new formula column from my starting capacity column. Any help would be greatly appreciated.