Hit the function limit in calc
I have a number of cells that autofill based on data from 4 other cells
The sheet is used in a tabletop RPG to develop weapons
User determines: class (7), subclass (3 or 4), type (2), and sometimes template (2)
What I started with (I’ve broken them down to make it easier to follow the nesting):
=IF(B3=“pistol”,
IF(B4=“holdout”,(INDEX(V5:V33,IF(B5=“plasma”,B2-1,B2-17),1)),
IF(B4=“light”,(INDEX(W5:W33,IF(B5=“plasma”,B2-1,B2-17),1)),
IF(B4=“medium”,(INDEX(X5:X33,IF(B5=“plasma”,B2-1,B2-17),1)),
IF(B4=“heavy”,(INDEX(Y5:Y33,IF(B5=“plasma”,B2-1,B2-17),1)),“Subclass”)))),
IF(B3=“subassault”,
IF(B4=“light”,(INDEX(Z5:Z33,IF(B5=“plasma”,B2-1,B2-17),1)),
IF(B4=“medium”,(INDEX(AA5:AA33,IF(B5=“plasma”,B2-1,B2-17),1)),
IF(B4=“heavy”,(INDEX(AB5:AB33,IF(B5=“plasma”,B2-1,B2-17),1)),“Subclass”))),
IF(B3=“hunting”,
IF(B4=“light”,(INDEX(AC5:AC33,IF(B5=“plasma”,B2-1,B2-17),1)),
IF(B4=“medium”,(INDEX(AD5:AD33,IF(B5=“plasma”,B2-1,B2-17),1)),
IF(B4=“heavy”,(INDEX(AE5:AE33,IF(B5=“plasma”,B2-1,B2-17),1)),“Subclass”))),
IF(B3=“assault”,
IF(B4=“light”,(INDEX(AC5:AC33,IF(B5=“plasma”,B2-1,B2-17),1)),
IF(B4=“medium”,(INDEX(AD5:AD33,IF(B5=“plasma”,B2-1,B2-17),1)),
IF(B4=“heavy”,(INDEX(AE5:AE33,IF(B5=“plasma”,B2-1,B2-17),1)),“Subclass”))),
IF(B3=“support”,
IF(B4=“light”,(INDEX(AF5:AF33,IF(B5=“plasma”,B2-1,B2-17),1)),
IF(B4=“medium”,(INDEX(AG5:AG33,IF(B5=“plasma”,B2-1,B2-17),1)),
IF(B4=“heavy”,(INDEX(AH5:AH33,IF(B5=“plasma”,B2-1,B2-17),1)),“Subclass”))),
IF(B3=“sniping”,
IF(B4=“light”,(INDEX(AC5:AC33,IF(B5=“plasma”,B2-1,B2-17),1)),
IF(B4=“medium”,
IF(B6=“assault”,(INDEX(AD5:AD33,IF(B5=“plasma”,B2-1,B2-17),1)),
IF(B6=“support”,(INDEX(AG5:AG33,IF(B5=“plasma”,B2-1,B2-17),1)),“Template”)),
IF(B4=“heavy”,
IF(B6=“medium”,(INDEX(AG5:AG33,IF(B5=“plasma”,B2-1,B2-17),1)),
IF(B6=“heavy”,(INDEX(AH5:AH33,IF(B5"plasma",B2-1,B2-17),1)),“Template”)),“Subclass”))),
IF(B3=“sonic stunner”,“1”,“Subclass”),“Class”)))))))
I’ve started converting them to switches, but I’m not familiar with implementing switches; is there a method to nesting them?
So each section will be like this:
=SWITCH(B3=“pistol”,B4=“holdout”,INDEX(V5:V33,IF(B5=“plasma”,B2-1,B2-17),1),B4=“light”,INDEX(W5:W33,IF(B5=“plasma”,B2-1,B2-17),1),B4=“medium”,INDEX(X5:X33,IF(B5=“plasma”,B2-1,B2-17),1),IF(B4=“heavy”,INDEX(Y5:Y33,IF(B5=“plasma”,B2-1,B2-17),1),“Subclass”)