Home > database >  I keep getting #NA
I keep getting #NA

Time:01-10

=IF(and(or(U3="Pro",U3="Standard"),T3>0,"Charged",If(and(U3="Lite",T2. 0),"Charged","FOC")))

Got a #NA Error Wrong number of arguments to IF. Expected between 2 and 3 arguments, but got 1 arguments.

CodePudding user response:

If I don't misunderstand what you're trying to achieve, you're missing a parenthesis after T3>0 in order to close the AND clauses:

=IF(and(or(U3="Pro",U3="Standard"),T3>0),"Charged",If(and(U3="Lite",T2. 0),"Charged","FOC"))

And I don't know what you meant with "T2. 0"

CodePudding user response:

use:

=IF(AND(OR(U3="Pro", U3="Standard"), T3>0), "Charged", 
 IF(AND(U3="Lite", T2 0), "Charged", "FOC"))

or:

=IF((REGEXMATCH(U3, "Pro|Standard")*(T3>0), "Charged", 
 IF((U3="Lite")*(T2 0), "Charged", "FOC"))

CodePudding user response:

Try ifs(), like this:

=ifs( 
  T3 = "", iferror(1/0), 
  T3 < 0, "Reimbursement", 
  T3 = 0, "Free of charge", 
  true, "Charged" 
)
  • Related