• 463K Members
• 12.4K Online
• 560K Conversations
SOLVED

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

# 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!

# 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","")`
Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies