• 544K Members
• 8,112 Online
• 648K Conversations
SOLVED

Highlighted
New Contributor

# Complicated Programming Help (Tried using IF/Not/logical statements)

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.

3 Replies
Highlighted
Solution

# Re: Complicated Programming Help (Tried using IF/Not/logical statements)

Hello @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!

Highlighted

# Re: Complicated Programming Help (Tried using IF/Not/logical statements)

Thank you so much! I had no clue that we had to press control+shift+enter for array formulas!

Highlighted

# Re: Complicated Programming Help (Tried using IF/Not/logical statements)

As a variant

`=SWITCH(SUMPRODUCT((F3:F11+G3:G11*10)*(ROW(F3:F11)-ROW(\$F\$2))),8,"MBA",16,"NA",30,"XBA",15,"both","")`