How to Combine these formulas

I posted yesterday about a grid that I have since revamped. I am super new at this and spent a lot of time trying different formulas and watching videos. The formulas are working as standalones but I am having trouble when combining them. Standalone Formulas:

=IF(Type@row = "Medium", WORKDAY([R Date]@row, +10))

=IF(Type@row = "Large", WORKDAY([R Date]@row, +15))

=IF(Type@row = "Small", WORKDAY([R Date]@row, +5))

Combined formula (which is not working and just displays blank as you see in the red cell below):

=IF(CONTAINS(Type@row = "Small", WORKDAY([R Date]@row, +5)), IF(CONTAINS(Type@row = "Medium", WORKDAY([R Date]@row, +10)), IF(CONTAINS(Type@row = "Large", WORKDAY([R Date]@row, +15)))))

What am I doing wrong?

Answers

  • Brian_Richardson
    Brian_Richardson Overachievers Alumni
    edited 05/23/24

    The CONTAINS function doesn't work as you've written it. It's not CONTAINS ( field = something), it's CONTAINS (search_for, range)

    As an individual formula it would be written like this:

    =IF(CONTAINS("Small",Type@row), WORKDAY([R Date]@row, +5))

    As a combined nested IF formula it would be this:

    =IF(CONTAINS("Small",Type@row), WORKDAY([R Date]@row, +5) , IF(CONTAINS("Medium",Type@row), WORKDAY([R Date]@row, +10), IF(CONTAINS("Large",Type@row), WORKDAY([R Date]@row, +15) )))

    BRIAN RICHARDSON | PMO TOOLS AND RESOURCES | HE|HIM

    SEATTLE WA, USA

    IRON MOUNTAIN

  • This was extremely helpful. I tried to find the different scenarios for IF Contains and this formula worked, it just needed brackets in the type@row section. Thank you

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!