SOLVED

Nested AND OR

%3CLINGO-SUB%20id%3D%22lingo-sub-2654501%22%20slang%3D%22en-US%22%3ENested%20AND%20OR%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2654501%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3DIF(AND(OR(K2%26lt%3B%3DTODAY%2CL2%3DY))%2C(OR(P2%26lt%3B%3DTODAY%2CQ2%3DY)))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20get%20the%20row%20to%20highlight%20if%20either%20(K2%20or%20L2%20is%20True)%20AND%20(P2%20or%20Q2%20is%20True)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDate%20in%20K2%20is%20equal%20to%20or%20less%20than%20TODAY%20OR%20if%20L2%3DY%3C%2FP%3E%3CP%3EAND%3C%2FP%3E%3CP%3EDate%20in%20P2%20is%20equal%20to%20or%20less%20than%20TODAY%20OR%20if%20Q2%3DY%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20what%20I%20am%20trying%20to%20use%20but%20it's%20not%20working%3A%3C%2FP%3E%3CP%3E%3DIF(AND(OR(K2%26lt%3B%3DTODAY%2CL2%3DY))%2C(OR(P2%26lt%3B%3DTODAY%2CQ2%3DY)))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHelp%2C%20please%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2654501%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2654568%22%20slang%3D%22en-US%22%3ERe%3A%20Nested%20AND%20OR%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2654568%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1052586%22%20target%3D%22_blank%22%3E%40brendababy02%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETry%20it%20this%20way%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DAND(OR(%24K2%26lt%3B%3DTODAY()%2C%24L2%3D%22Y%22)%2COR(%24P2%26lt%3B%3DTODAY()%2C%24Q2%3D%22Y%22))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20don't%20need%20the%20IF%2C%20the%20correct%20syntax%20for%20the%20TODAY%20function%20is%20to%20add%20the%20two%20brackets%2C%20and%20when%20you%20compare%20to%20a%20text%20you%20must%20enclose%20the%20text%20in%20quotation%20marks.%20And%20finally%2C%20you%20need%20to%20fix%20the%20column%20references%20with%20%24%20sign.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2654576%22%20slang%3D%22en-US%22%3ERe%3A%20Nested%20AND%20OR%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2654576%22%20slang%3D%22en-US%22%3EThank%20you%2C%20I%20forgot%20about%20the%20brackets%20and%20the%20%24.%20Now%20it%20is%20highlighting%20the%20entire%20row%20even%20though%20nothing%20is%20entered.%20I%20think%20this%20has%20to%20do%20with%20the%20%26lt%3B%20for%20the%20date.%20Any%20suggestions%3F%3C%2FLINGO-BODY%3E
Occasional Contributor

 

 

 

=IF(AND(OR(K2<=TODAY,L2=Y)),(OR(P2<=TODAY,Q2=Y)))

 

 

 

I am trying to get the row to highlight if either (K2 or L2 is True) AND (P2 or Q2 is True)

 

Date in K2 is equal to or less than TODAY OR if L2=Y

AND

Date in P2 is equal to or less than TODAY OR if Q2=Y

 

This is what I am trying to use but it's not working:

=IF(AND(OR(K2<=TODAY,L2=Y)),(OR(P2<=TODAY,Q2=Y)))

 

Help, please

 

4 Replies
best response confirmed by brendababy02 (Occasional Contributor)
Solution

@brendababy02 

Try it this way:

 

=AND(OR($K2<=TODAY(),$L2="Y"),OR($P2<=TODAY(),$Q2="Y"))

 

You don't need the IF, the correct syntax for the TODAY function is to add the two brackets, and when you compare to a text you must enclose the text in quotation marks. And finally, you need to fix the column references with a $ sign.

Thank you, I forgot about the brackets and the $. Now it is highlighting the entire row even though nothing is entered. I think this has to do with the < for the date. Any suggestions?

@brendababy02 Add another rule (should be the first one in the list) and mark it to "Stop if true". For instance, if A2 is empty than don't format anything.

 

=ISBLANK($A2)

 

Thank you, that fixed it. I'm still trying to figure out Excel. Now to add my other formulas in other cells and hopefully have them in the right order. Thank you, thank you, thank you.