Google-sheets – Nested IF with FIND

formulasgoogle sheets

I have a list of transactions in column A that I want to categorize.

I want to search A1 for, say, "Shoprite" and if found return "Groceries", otherwise search for "Shell" and return "Gas", otherwise search for "Netflix" and return "Entertainment"

I tried (among other things):

=IF(FIND("Shoprite",A1), "Groceries", IF(FIND("Shell",A1),"Gas", IF(FIND("Netflix", A1),"Entertainment")))

Best Answer

  • try like this:

    =IF(A1="Shoprite", "Groceries",
     IF(A1="Shell", "Gas",
     IF(A1="Netflix", "Entertainment", )))

  • if A1 doesn't say exactly Shoprite, but rather Shoprite on 7th, then use this:

    =IF(A7=IFERROR(FILTER(A7, (ISNUMBER(SEARCH("Shoprite", A7)))), ), "Groceries",
     IF(A7=IFERROR(FILTER(A7, (ISNUMBER(SEARCH("Shell",    A7)))), ), "Gas",
     IF(A7=IFERROR(FILTER(A7, (ISNUMBER(SEARCH("Netflix",  A7)))), ), "Entertainment", )))