Nick Stojanoff
Nick Stojanoff

Reputation: 1

Conditional date formatting based on adjacent cells

| start date | end date | 
| 1/19/2019  | 2/1/2019 |
| 5/1/2019   | 3/8/2019 | 
| 4/1/2019   | 9/1/2019 | 

I have a list of date in excel with A1 being the start date and B1 being the end date. I need to highlight the cells in A that end after than their adjacent cells in B, since start date can't be after end date. I tried "Use a formula to determine which cells to format" and did =a2>b2 and then apply it to =$A:$A and =A:A, but neither seems to be highlighting like I need. Any recommendations on how to do highlight the A cells only that are larger than the adjacent B?

Upvotes: 0

Views: 394

Answers (2)

Ricardo Diaz
Ricardo Diaz

Reputation: 5696

Key here is first select cell A1 then select the whole column A and then click Home | Conditional formatting | new rule | Use a formula...

In the text box format values... write this =A1>B1

Click the format button and set the custom formatting

Click ok

Edit: as OP stated in the comments not in the question, you should select first A2

Upvotes: 0

BigBen
BigBen

Reputation: 49998

Make sure your formula and "Applies to" range line up, i.e. if the formula is A2 then the "Applies to" range should start in A2.

enter image description here

If you are applying the conditional formatting to the entire column, without highlighting the title row, you could do the following:

 =AND(ISNUMBER(A1),A1>B1)

enter image description here

Upvotes: 1

Related Questions