Share via

Conditional formatting based on comparing 2 dates (fields)

Anonymous
2012-10-24T22:48:25+00:00

This seems like it should be simple, but I'm scratching my head.  I want to compare an initial date with a revised date and have the revised date cell format differently (such as red) if the date is later.  I'm using Excel 2007 if that matters.  This would be applied to columns of values.  What is a good way to handle this?

Thanks!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2012-10-24T23:41:53+00:00

Let's say initial dates are in B2:B50 and revised dates in D2:D50.

Select D2:D50. I will assume that D2 is the active cell within the selection.

On the Home tab of the ribbon, click Conditional Formatting > New Rule...

Select 'Format only cells that contain'.

Leave the first dropdown set to 'Cell Value'.

Select 'greater than' from the second dropdown.

Enter   =B2   in the box next to it.

Click Format...

Specify the desired formatting.

Click OK twice.

Was this answer helpful?

9 people found this answer helpful.
0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2012-10-25T14:54:45+00:00

Select the range again.

Click Conditional Formatting > Manage Rules...

Make sure the rule is selected, then click Edit Rule...

Click 'Use a formula to determine which cells to format'.

Enter the formula   =AND($B2<>"",$D2>$B2)

(Note the use of $)

OK your way out.

Was this answer helpful?

7 people found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2012-10-25T15:46:26+00:00

    Hi Hans,

    Thanks so much - this is the formula I couldn't put together!  I appreciate your help!

    Scott

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2012-10-25T14:06:53+00:00

    Thanks Hans for your help.  I only needed to change the cell reference from $B$2 to $B2 so that each row related to the data in that record. 

    One further questions.  If there is a date entered into colum D but column B is blank for that row, the date is auto formatted.  Is there a simple way to not format if column B is blank for a row?

    Many thanks again!

    Scott

    Was this answer helpful?

    0 comments No comments