Jun 21 2019 06:05 AM
Hello!
I'm trying to create a program where specific combinations of "TRUE" values will output FOUR different responses (MBA, NA, XBA, and both). For instance, if JUST cells F3 and F9 are selected as "TRUE," and the other cells are "FALSE" the output will be "MBA." However, if cells F3, F9, and F10 are selected as "TRUE," the output will be NA. Furthermore, if JUST cells G3 and G4 are "TRUE," the output will be "XBA," and if JUST cells F9 and F10 are selected, the output will be "both." Etc..., there are multiple combinations that I hope to program into four different outputs. Do you have any suggestions as to how I should do this? I have tried using if/not statements; however, the code gets messy quickly.
Thanks for your time!
Jun 21 2019 06:33 AM
SolutionHello @shia1700,
Try this formula out:
=IF(AND(F3=TRUE,F9=TRUE,F4:F8=FALSE,F10:F11=FALSE,G3:G10=FALSE),"MBA",IF(AND(F3=TRUE,F9=TRUE,F10=TRUE,F4:F8=FALSE,F11=FALSE,G3:G10=FALSE),"NA",IF(AND(G3:G4=TRUE,F3:F11=FALSE,G5:G10=FALSE),"XBA",IF(AND(F9:F10=TRUE,F3:F8=FALSE,G3:G10=FALSE),"both","NO RESULT"))))
This is an array formula so you will have to press ctrl+shift+enter.
Hope this helps!
Jun 28 2019 07:44 AM
Thank you so much! I had no clue that we had to press control+shift+enter for array formulas!
Jun 29 2019 03:55 AM
As a variant
=SWITCH(SUMPRODUCT((F3:F11+G3:G11*10)*(ROW(F3:F11)-ROW($F$2))),8,"MBA",16,"NA",30,"XBA",15,"both","")
Jun 21 2019 06:33 AM
SolutionHello @shia1700,
Try this formula out:
=IF(AND(F3=TRUE,F9=TRUE,F4:F8=FALSE,F10:F11=FALSE,G3:G10=FALSE),"MBA",IF(AND(F3=TRUE,F9=TRUE,F10=TRUE,F4:F8=FALSE,F11=FALSE,G3:G10=FALSE),"NA",IF(AND(G3:G4=TRUE,F3:F11=FALSE,G5:G10=FALSE),"XBA",IF(AND(F9:F10=TRUE,F3:F8=FALSE,G3:G10=FALSE),"both","NO RESULT"))))
This is an array formula so you will have to press ctrl+shift+enter.
Hope this helps!