Google-sheets – IF Function with too many arguments

formulasgoogle sheetsregex

I want to apply this formula

=IF(A2= "", "", 
 IF(REGEXMATCH(A2, "Brand"), "Brand", 
 if(regexmatch(A2, "Loans"), "Loans" , 
 if(regexmatch(A2, "Cards"), "Credit Cards", 
 if(A2, "Generic"),"Generic", 
 if(REGEXMATCH(A2, "Generic"), "Generic", "Non-brand")))))

But it has more than 3 arguments.

Any idea on how I could make this work?

Best Answer

=IF(A2<>"", 
 IF(REGEXMATCH(A2, "Brand"), "Brand", 
 IF(REGEXMATCH(A2, "Loans"), "Loans" , 
 IF(REGEXMATCH(A2, "Cards"), "Credit Cards", 
 IF(A2="Generic", "Generic", 
 IF(REGEXMATCH(A2, "Generic"), "Generic", "Non-brand"))))), )

0