Forum Discussion
mfree0107
Apr 26, 2022Copper Contributor
IF FORMULA ERROR MESSAGE "YOU'VE ENTERED TOO MANY ARGUMENTS FOR THIS FUNCTION"
TRYING TO ADD ONE MORE CONDITION "(IF($I2="CONC W REBAR",($O2)," TO THIS FORMULA
=IF($H2="cw",(IF($I2="ASPHALT",($O2),(IF($I2="BRICKS",($O2),(IF($I2="CONCRETE",($O2),(IF($I2="DIRT/GRAVEL",($O2),(""))))))))),(""))
WHEN I ADD IT THE I GET THE ERROR MESSAGE "YOU'VE ENTERED TOO MANY ARGUMENTS FOR THIS FUNCTION"
=IF($H2="cw",IF($I2="ASPHALT",$O2,IF($I2="BRICKS",$O2,IF($I2="CONCRETE",$O2,IF($I2="DIRT/GRAVEL",$O2,IF($I2="CONC W REBAR",$O2,""))))),"")Does this work in your sheet? I removed some " ( " and " ) " which makes the formula easier in my opinion.
3 Replies
- PeterBartholomew1Silver Contributor
It is also possible to reformulate the formula to reduce the level of nesting,
=IF(code="cw", SWITCH(material, "ASPHALT", return, "BRICKS", return, "CONCRETE", return, "DIRT/GRAVEL", return, "CONC W REBAR", return, ""), "")or
= IF(code="cw", IF( OR(material={"ASPHALT","BRICKS","CONCRETE","DIRT/GRAVEL","CONC W REBAR"}), return, ""), "")The latter would require a Lambda helper function if it were to be used as an array formula over 'code' and 'material'.
- OliverScheurichGold Contributor
=IF($H2="cw",IF($I2="ASPHALT",$O2,IF($I2="BRICKS",$O2,IF($I2="CONCRETE",$O2,IF($I2="DIRT/GRAVEL",$O2,IF($I2="CONC W REBAR",$O2,""))))),"")Does this work in your sheet? I removed some " ( " and " ) " which makes the formula easier in my opinion.
- mfree0107Copper ContributorThanks for the suggestion!