Excel: Given workday, how to find prior day such that it’s a particular work day and avoids holidays?

I need to prepare an Excel worksheet to do the following: Given the date of a work day (DATE_WORKDAY_1), find the date of a previous work day (DATE_WORKDAY_2) such that

  • I can specify the weekday of DATE_WORKDAY_2
  • The number of workdays between DATE_WORKDAY_1 and DATE_WORKDAY_2 is greater than or equal to a specific value
  • Specified dates are excluded

Example:

  • DATE_WORKDAY_1 = 07/30/2026
  • DATE_WORKDAY_2 must be a Tuesday
  • Dates to be excluded: 07/28/2027, 07/21/2026

If there must be at least 3 workdays between DATE_WORKDAY_1 and DATE_WORKDAY_2, the worksheet should return 07/21/2026. If there must be at least 8 workdays between the two dates, the worksheet should return 07/14/2026.

I’m an Excel novice and would greatly appreciate any pointers.