简体   繁体   中英

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?

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

在此处输入图片说明

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)

在此处输入图片说明

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM