Conditional Formating - Time difference

R

Roman

I have 2 columns, Column A for 'Arrival Time' and Column B for 'Departure
Time' .
If the 'departure Time' minus 'Arrival Time' is greater than 8 hrs,
background color of both the columns A and B should be changed to green,
otherwise color should be red. How can I achieve this using conditional
formatting?
 
T

Toppers

Highlight column A:

CF 1: Formula is: =AND(A1<>"",B1<>"",(B1-A1+(B1<A1))*24>8) and set to green
CF2: Formula is: ==AND(A1<>"",B1<>"",(B1-A1+(B1<A1))*24<=8) and set to red

Repeat for column B

HTH
 
B

Bob Phillips

alternatives

=AND(COUNT(A1:B1)=2,MOD(B1-A1,1)*24>8)

=AND(COUNT(A1:B1)=2,MOD(B1-A1,1)*24<=8)

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top