Forum Discussion
Kristie365
Dec 05, 2023Copper Contributor
Excel Formula Error - Too Many Arguments - Comma or Parenthesis Error?
Greetings, I am trying to create the following formula - =IF(F2=$P$2,IF(M2>0.6,3%,IF(M2>0.5,2%,IF(M2>0.4,1%,IF(M2>0.3,0%)))),IF(F2=$P$4,IF(M2>0.6,3%,IF(M2>0.5,2%,IF(M2>0.4,1%,IF(M2>0.3,0%)))),I...
- Dec 05, 2023
HansVogelaar This works! Thank you so much! And now makes much more sense. Have a wonderful day.
PeterBartholomew1
Dec 05, 2023Silver Contributor
Since you are catering for 4 options for $P$2, IF was always going to be a mess. SWITCH caters for any number of conditions and could be read more easily. The percentages returned for various values of $M$2 are probably best looked up from a table but IFS would also offer a reasonably clear syntax
= SWITCH($F$2,
$P$2, IFS($M$2>0.6, 3%, $M$2>0.5, 2%, $M$2>0.4, 1%, $M$2>0.3, 0%),
$P$4, IFS($M$2>0.6, 3%, $M$2>0.5, 2%, $M$2>0.4, 1%, $M$2>0.3, 0%),
$P$3, 3%,
$P$5, 1%
)