简体   繁体   中英

Compare two columns of dates and highlight if the first one is older

I am trying to compare two columns of dates. The first column has dates and times the second column is only dates. I need to highlight the second column if the date is before the date in the first column.

I need to ignore the time and only compare the dates. I still need the time to show so I can't reformat the data.

Here is a sample. The first date would not be highlighted because the must arrive date is after latest delivery. The second row the must arrive date would be highlighted as it the delivery date is after and the third row would not be highlighted because it delivers the same day.

   Latest     |  Delivery | Must Arrive By
-------------------------------------------
8/ 8/18 23:55 | 8/10/2018 |
7/31/18 11:00 | 7/29/2018 |
7/29/18 22:00 | 7/29/2018 |

Here's a conditional formatting approach, using ROUNDDOWN to ignore the hours/minutes portion of the latest delivery date/time.

Format values where this formula is true:

=B2<ROUNDDOWN(A2,0)

在此处输入图片说明

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