Highlighting Weekend Dates

I saw a few threads about a formula that highlights weekend dates. A formula that I've seen is

=IF(OR(WEEKDAY([Date Column]@row) = 1, WEEKDAY([Date Column]@row) = 7), "Weekend")

and I've tried that, but I keep getting the error that says 'Invalid Data Type'. Anyone know why this may be happening?

Best Answer

  • kira11
    kira11 ✭✭✭
    Answer ✓

    My guess would be there are some blanks in your dataset. I would suggest wrapping the WEEKDAY portions in an IFERROR.

    =IF(OR(IFRROR(WEEKDAY([Date Column]@row), 0) = 1, IFERROR(WEEKDAY([Date Column]@row), 0) = 7), "Weekend")

Answers

  • heyjay
    heyjay ✭✭✭✭✭

    Did you use a Text/number data type for your helper column? Is your Date column set up as date type?

    ...

  • kira11
    kira11 ✭✭✭
    Answer ✓

    My guess would be there are some blanks in your dataset. I would suggest wrapping the WEEKDAY portions in an IFERROR.

    =IF(OR(IFRROR(WEEKDAY([Date Column]@row), 0) = 1, IFERROR(WEEKDAY([Date Column]@row), 0) = 7), "Weekend")

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!