Formula for calculating overlapping dates for approval tasks

I am trying to find a way to properly calculate how long an approval takes from an outside source. Is there a formula or a workflow that can take overlapping dates and give the correct answer? I also need the formula to be able to update if the initial start date gets pushed out.

I have attached an image of the date layout. If the dates overlap (for example 1/11/24 - 2/21/24 and 1/12/24-1/12/24 have a day overlap so the total would be 30 days not 31). I can clarify if needed.


Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!