Looking to create an =IF(CONTAINS Function for a formatted Date field

Options

Hello!

I'm looking to create an =IF(CONTAINS function to pull the day of the week into a separate column from the formatted date column.


For example:

I want the "Event Day" column to turn Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, or Sunday depending on what is in the Event Date column.

I have created this formula, but cannot turn any results - doesn't turn unparseable but just leaves cell blank even when it should be applicable. (haven't done for all 7 days of the week yet to leave less room for error):

=IF(CONTAINS("Mon", [Event Date]@row), "Monday", IF(CONTAINS("Tue", [Event Date]@row), "Tuesday", ""))


We were able to get this function to work, but this is only applicable for one day of the week and we have not been able to duplicate it for all the days of the week.

=IF(CONTAINS("Mon", [Event Date]:[Event Date]), "True", "Mon")

Is anyone able to correct my function or provide alternate suggestions? The reason we want to pull this data is to get this day of the week into Smartsheet Dynamic, as we have learned that Dynamic only allows the date to be formatted in one way in the view, regardless of the formatting in the source report, and it does not include the day of the week. Thank you!

Tags:

Best Answer

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    edited 05/25/21 Answer ✓
    Options

    Hi Chantal,

    Try:

    =IF(weekday([event date]@row)=1, "Sunday", IF(weekday([event date]@row)=2, "Monday", IF(weekday([event date]@row)=3, "Tuesday", IF(weekday([event date]@row)=4, "Wednesday", IF(weekday([event date]@row)=5, "Thursday", IF(weekday([event date]@row)=6, "Friday", "Saturday"))))))

    Work?

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

Answers

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    edited 05/25/21 Answer ✓
    Options

    Hi Chantal,

    Try:

    =IF(weekday([event date]@row)=1, "Sunday", IF(weekday([event date]@row)=2, "Monday", IF(weekday([event date]@row)=3, "Tuesday", IF(weekday([event date]@row)=4, "Wednesday", IF(weekday([event date]@row)=5, "Thursday", IF(weekday([event date]@row)=6, "Friday", "Saturday"))))))

    Work?

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

  • Chantal Wiesner
    Options

    Yes this worked - thank you so much!

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    Options

    Excellent. Thank you for contributing to the Community.

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!