Workday is not omitting the holidays?

Options
Pauline J
Pauline J ✭✭✭✭✭
edited 06/13/25 in Formulas and Functions

I have tested this manually, as well as outside of my formulas. I want to reference a date, and then search on the Holidays range (a list of holidays) and return the previous workday if the date is found in the holiday list.

The formula ALWAYS returns the day before the date, whether it's in the holiday list or not. Any help is much appreciated; I have tried variations, tried using CONTAINS, but I cannot get the results I need. I copied all the holiday dates into a date field into the same sheet, and AI suggested using

=IF(CONTAINS([Due Date]@row , [Holidays]:[Holidays]), [Due Date]@row + 1, [Due Date]@row )

But nothing is working…..

My structure: List of holidays is in a sheet called Holidays (and yes, I'm showing 2024, but that doesn't matter)

image.png

Column Formula in CalcDueDt-Hol:
=WORKDAY([Due Date]@row , -1, {Holidays Range 1})

In the top row, below, the result should be the working day before 2/19/2024, because that date is in the holiday list. But it returns the previous working day for ALL Due Dates; the rows in white are NOT in the holiday list.

image.png

Best Answer

  • Gia Thinh
    Gia Thinh Community Champion
    edited 06/15/25 Answer ✓

    Hello @Pauline J

    I tried to put the HolidayDt into the same sheet to easy simulate your use case, as shown below.

    Try the formula below for the CalcDueDt-Hol:

    =IFERROR(WORKDAY([Due Date]@row , IF(HAS(HolidayDt:HolidayDt, [Due Date]@row ), -1, 0), HolidayDt:HolidayDt), "")

    The highlighted IF() returns (-1) if the Due Date found in the HolidayDt, else returns (0). This will help to return the previous workday if the Due Date is found in the holiday list, else keep the same Due Date.

    You can change the HolidayDt range in the above formula if you put it in another sheet, as below:

    =IFERROR(WORKDAY([Due Date]@row , IF(HAS({Holidays Range 1}, [Due Date]@row ), -1, 0), {Holidays Range 1}), "")

    image.png

    Hope this works for you.

    Gia Thinh Technology - Smartsheet Solution Partner.
    Email : thinh.huynh@giathinh.tech

Comments

  • Gia Thinh
    Gia Thinh Community Champion
    edited 06/15/25 Answer ✓

    Hello @Pauline J

    I tried to put the HolidayDt into the same sheet to easy simulate your use case, as shown below.

    Try the formula below for the CalcDueDt-Hol:

    =IFERROR(WORKDAY([Due Date]@row , IF(HAS(HolidayDt:HolidayDt, [Due Date]@row ), -1, 0), HolidayDt:HolidayDt), "")

    The highlighted IF() returns (-1) if the Due Date found in the HolidayDt, else returns (0). This will help to return the previous workday if the Due Date is found in the holiday list, else keep the same Due Date.

    You can change the HolidayDt range in the above formula if you put it in another sheet, as below:

    =IFERROR(WORKDAY([Due Date]@row , IF(HAS({Holidays Range 1}, [Due Date]@row ), -1, 0), {Holidays Range 1}), "")

    image.png

    Hope this works for you.

    Gia Thinh Technology - Smartsheet Solution Partner.
    Email : thinh.huynh@giathinh.tech

  • Pauline J
    Pauline J ✭✭✭✭✭

    @Gia Thinh That works!!! Thank you so much — this one was really frustrating to me. I'm making the adjustments to all of my sheets now. You rock! 😀

  • Gia Thinh
    Gia Thinh Community Champion

    Glad to hear it worked well for you.

    Gia Thinh Technology - Smartsheet Solution Partner.
    Email : thinh.huynh@giathinh.tech

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!