Solution:
You can use INDIRECT
function in your conditional formatting custom formulas to highlight cells based on values from different sheet:
In your sample, you would need three rules:
Highlight Cells Red:
Custom Formula: =COUNTIF(INDIRECT("Filter!$AP5:$AP"), $C4)>0
Highlight Cells Green:
Custom Formula: =COUNTIF(INDIRECT("Filter!$AQ5:$AQ"), $C4)>0
For the warning, you can turn the cells a different color (I'll use gray). This rule should be on the top.
Custom Formula: =COUNTIF(INDIRECT("Filter!$AP5:$AQ"), $C4)>0
Sample Sheet:
References:
INDIRECT()
Conditional Formatting from another sheet
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…