Don't forget to register for our panel discussion with Dean Stoecker, Amy Holland, and Mark Frisch occurring next Wednesday, June 1!

2022-05-26 Updates: Email: If you're not seeing emails be delivered from the Community, please check your spam and mark the Community emails as not junk. Thank you for your patience.
alteryx Community

# Alteryx Designer Discussions

SOLVED

## Calculate difference between two dates and exclude weekends and Country Holidays

8 - Asteroid

What is the best way to workout a formula that calculates the difference between two dates but also factors in weekends and the country holidays.

E.g if the Difference between two days is 8 and there is a weekend in between, the no of days would be 6 but if there was a public holiday also in between these two days, it would bring the diff to 5.

Refer to attached file with first worksheet that has the two dates i want to calculate the difference. Request Creation Date is 29th July and Approval Date is 6th Aug. I've also created a dummy public holiday 5th Aug.

What is the best way to calculate the difference between these two dates and exclude the weekends (Sart and Sun) as well as the dummy public holiday.

4 REPLIES 4
22 - Nova

Here is how you can do it.

Workflow:

1. Using record id to set unique row id.

2. Using generate rows tool to generate rows between dates.

3. Using filter tool to filter weekends out.

4. Using join tool and taking left unjoin to filter out holidays from the list.

5. Using summarize to get the day count.

Hope this helps : )

8 - Asteroid