jeudi 7 mai 2015

Excel: Compare Contents of a Cell to a Column within an "If, Then"

Attempted formula: =IF(S2="AK",IF(COUNTIF(AB:AB,"<>"&T2),"OTO",IF(U2 = "AK",IF(COUNTIF(AB:AB,"<>"&V2),"OTO",""))))

Research led me to =COUNTIF(AB:AB,"<>"&T2) to check the the contents of t2 against AB. That part works. When I plug that into just a step further, =IF(COUNTIF(AB:AB,"<>"&T2),"OTO","")), I lose something.

My goal in English: If the O-State(S) is AK and the O-Zip(T) is NOT in the list of AK Zips(AB), show "OTO" in H/P/O(D), otherwise if the D-State(U) is AK and the D-Zip(V) is NOT in the list of AK Zips(AB), show "OTO" in H/P/O(D), otherwise null.

What am I missing? (Data excerpt below)

D-------S--------T-------U-------V--------AB
H/P/O O-State O-Zip D-State D-Zip AK Zips
-------- TN 37046 AK 99518 99901
-------- AK 99613 WA 98663 99928
-------- AZ 86004 AK 99613 99926
-------- GA 30507 AK 99518 99835
-------- AK 99518 NY 13676 99801

Aucun commentaire:

Enregistrer un commentaire