You will want to create two conditional formatting rules. First select B2:J6 (as laid out in the image below, the bottom row will vary with your own data) with B2 as the Active Cell
. Create a new formula using the Use a formula to determine which cells to format and supply the following for Format values where this formula is true:
=AND(OR($A2="P1",$A2="P2",$A2="P3",$A2="P4",$A2="P5",$A2="YR"),B2<=EDATE(TODAY(),(1+($A2="YR"))*-12))
Click Format and supply a red Fill. I also added a white Font for readability. Click OK to accept the format and then OK again to create the new rule.
With B2:J6 still selected, repeat with the following formula for a yellow fill.
=AND(OR($A2="P1",$A2="P2",$A2="P3",$A2="P4",$A2="P5",$A2="YR"),B2>EDATE(TODAY(),(1+($A2="YR"))*-12),B2<=(EDATE(TODAY(),(1+($A2="YR"))*-12)+30))
You results should be similar to the following.
?????
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…