So I have a table of roughly 200 internet search keywords from two different companies, which I want to sort. One is Walmart the other is Costco.
So keywords might look something like this:
"Walmart Canada"
"Walmart groceries"
"Walmart"
"Costco Canada"
"Costco"
"Costco bulk prices"
and so on.
In column B, I want to display the following numbers: 1 if it refers to Walmart, 2 if it refers to Costco and 3 if it contain a keyword that refers to BOTH. So in this case it should show:
3 (Canada it common to both)
1
1
3 (Canada is common to both)
2
2
What I'm having trouble with is displaying the 3's. These are different approaches I've been taking:
=IF(ISNA(VLOOKUP("walmart",A3:C103,1,FALSE)),1,IF(ISNA(VLOOKUP("groceries",A3:C103,1,TRUE)),1,IF(ISNA(VLOOKUP("Costco",A3:C103,1,FALSE)),3,2)))
OR
=IF(AND(NOT(ISNA(MATCH(A2,walmart!$A$2:$A$102,0))),NOT(ISNA(MATCH(A2,costco!$A$2:$A$102,0)))),2,IF(NOT(ISNA(MATCH(A2,walmart!$A$2:$A$102,0))),1,IF(NOT(ISNA(MATCH(A2,walmart!$A$2:$A$102,0))),,2)))
In the first case, it works but I can't get 3's to show up, and I need too many words for the formula to work (given that I have so many keywords). I've used to formula with a much greater number of words but given all the words, it won't work.
In the second case, I can get 1's and 2's, but once more the 3's won't show. It's as if "walmart" will take precedence over "canada", so it'll mark it as a 1. I've tried simply with If and vlookup but this is starting to frustrate me.
Thanks in advance for any input.
-B
Bookmarks