I have a large list of users with various codes. The goal is to separate the good from the bad. All codes that start with P, H or F are good. All codes that start with L or K are bad. Example:
Email | Code 01 | Code 02 | Code 03 | Code 04 | RESULT
user01@gmail.com | PJR-VRF | | | | GOOD
user01@gmail.com | | LNR-JNT | | LNR-JNT | BAD
user01@gmail.com | | HVB-YWQ | HVB-YWQ | HVB-YWQ | GOOD
user01@gmail.com | | LNR-JNT | | KVB-MMO | BAD
user02@gmail.com | | | | PHH-KLP | GOOD
user02@gmail.com | | HNR-OPT | | LNR-JNT | GOOD
user02@gmail.com | | FLT-MWQ | | FLT-MWQ | GOOD
user02@gmail.com | | KVB-MMO | KVB-MMO | KVB-MMO | BAD
In other words, if a range contains any cells that begin with P, H, or F then good, otherwise bad. I've tried to use the following formula in the result column:
=IF(COUNTIF(B2:E2,{"H*","P*","F*"}),"good","bad")
It didn't work unfortunately, so I tried this:
=IF(COUNTIF(B2:E2,"H*") + COUNTIF(B2:E2,"P*") + COUNTIF(B2:E2,"F*"),"good","bad")
This seems to work, but is this the best method? Say I have 20 other conditions to check against? And need to add a third result? What is the best approach to sift this data?