Conditional formatting

Daahak

New Member
Joined
Sep 7, 2022
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
Hi All,

Id noNamePassport typeExpiration day
1JohnDiplomatic18 march 2023
2MarieTurist05 december 2022
3MichaelBlue27 mai 2020
4NickOld12 january 2023
5Matew(Blank)(Blank)


I am trying to create a conditional formating rule for a working spreadsheet I use at work.
As you see in the table i have names, passport types and the expiration date for each (all the data in the table are fictive). So what I need is a formating that will change the color of the cells in the expiration date but with some conditions…
For every different type of passport I have a different period of time before the date occur when i have to submit the paperwork for revalidation
For diplo, turist and blue passports before expiration with 180 days
For old passports before expiration with 10 days

So… i want to:
  • fill the expiration day cell with red if is a diplo passport and there are less then 180 days untill expires,
  • fill the expiration day cell with red if is an old passport and there are less then 10 days untill expires
  • do nothing for the cells that are blank untill i write someting in (a guy gets a new passport)
Can someone assist me in this?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Welcome to the Board!

Assuming your data starts in cell A1, then select range D2:D6 and use this Conditional Formatting formula:
Excel Formula:
=OR(AND(OR($C2="Diplomatic",$C2="Turist",$C2="Blue"),$D2-TODAY()<180),AND($C2="Old",$D2-TODAY()<10))
and choose your red highlighting color.
 
Upvote 0
Solution
Welcome to the Board!

Assuming your data starts in cell A1, then select range D2:D6 and use this Conditional Formatting formula:
Excel Formula:
=OR(AND(OR($C2="Diplomatic",$C2="Turist",$C2="Blue"),$D2-TODAY()<180),AND($C2="Old",$D2-TODAY()<10))
and choose your red highlighting color.
Worked perfect! Tks so much!
 
Upvote 0
You are welcome.
Glad I was able to help!
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,199
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top