Conditional Formatting Not Working with Formula: change colour based on date

Patrick Reisch
edited 06/11/20 in Formulas and Functions

Hello everyone,

I'm trying to conditionally change the background color of a date column based on if it is today or yesterday. It works just fine if I type in a date, but if the date is populated via formula then it doesn't work. I have tried disabling and re-enabling with no luck. The cell in question references 2 other cells on the sheet like so:

=IF([Last Action Date]6 <> "No Data", IF([Last Action Date]6 > [Last Clean Date]6, [Last Action Date]6, [Last Clean Date]6), [Last Clean Date]6)

The cells it references reference other sheets, like so:

=IFERROR(INDEX({Tank Actions Date}, MATCH([Action Highest #]12, {Tank Actions #}, 0)), "No Data")

See attached photo for rules (top rule works just fine for a non-date condition)

image.png


Any idea why this might not be working?


Thanks

Best Answers

  • Patrick Reisch
    Answer ✓

    Hi everyone,


    Thanks a ton for the input. Based on your comments I surmised that I was in fact populating with a text value into the data type column. This was due to getting the date via a LEFT function on the created by column. I switched to the DATEONLY function and it is now functioning properly.


    Good to know that just because the column was a date type that a text value could still populate it and cause issues like this. I assumed that it just converted to date type automatically when the column type was set to that.


    Thanks again!

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!