I had a task where I wanted to compare one date column with another and to achieve something like this:

In your list settings click Add Column and select Calculated Field

The formula that finally worked was this:

=IF(ISBLANK([Completed Date]),”In Progress”,[Due Date]>=[Completed Date])

If you want to customize what it says instead of yes or no then this is the code:

=IF(ISBLANK([Completed Date]),”In Progress”,IF([Due Date]>=[Completed Date], “True”, “False”)

For the colors click the down arrow from my column On Time and select Format this column

Click manage rules

Click Add rule

You can use my picture above as an example of how to show certain colors for what data is in the field

for example If the column On Time is equal to No then the text will be red. Add all the conditions you want then click save.