I'm trying to do a multi level if else query in excel, where it would check multiple variables and if it falls into one of the categories then it would - a percentage and if it doesn't fall into any of the categories then it would say "N/A"
The pseudo code would look something like this:
If $income <90,000 and $age is <65 then - 27.82%,
else if $income range(90,000 - 105,000) and $age <65 then $premium - 18.55%,
else if $income range(105,001 - 140,000) and $age <65 then $premium - 9.27%,
else if $income >140,000 and $age <65 then - 0%,
else if $income <90,000 and $age range(65-69) then $premium - 32.46%,
else if $income range(90,000 - 105,000) and $age range(65-69) then $premium - 23.18%,
else if $income range(105,001 - 140,000) and $age range(65-69) then $premium - 13.91%,
else if $income >140,000 and $age range(65-69) then $premium - 0%,
else if $income <90,000 and $age <70 then - 37.09%,
else if $income range(90,000 - 105,000) and $age <70 then $premium - 27.82%,
else if $income range(105,001 - 140,000) and $age <70 then $premium - 18.55%,
else if $income >140,000 and $age <70 then $premium - 0%,
else "NA";
$income = cell j4
$age = cell i4
$premium = cell q4
I'm able to do a single level query that looks something like this:
=IF(AND(I5>64,I5<69,J5>90000,J5<105001),800*$Y$5,"NA")
but I'm not sure how to do a multiple if else statements in excel to capture all the possible categories or if there is a better way.
Aucun commentaire:
Enregistrer un commentaire