Forum Discussion
Conditional formulas based on which item is chosen in a drop-down menu
- Nov 12, 2026
In F2
=TEXT(SWITCH(A2,"Test A",(B2>=0.08)*(C2>=0.5)*(D2<0.08)*(E2<0.008),"Test B",(B2>=0.09)*(C2>=0.5)*(D2<1)*(E2<0.2),-1),"""Yes"";;""No""")in SWITCH you can add any Test x you need.
Bye
With 6 tests I'd keep the limits out of the formula and put them in a small table, one row per test. Say H1:L1 holds the headers Test, Min B, Min C, Max D, Max E, and rows 2 to 7 hold your six tests (Test A: 0.08, 0.5, 0.08, 0.008; Test B: 0.09, 0.5, 1, 0.2; and so on). The names in column H have to match the drop-down items exactly.
Then in F12:
=IF(A12="","",IF(AND(B12>=VLOOKUP(A12,$H$2:$L$7,2,FALSE),C12>=VLOOKUP(A12,$H$2:$L$7,3,FALSE),D12<VLOOKUP(A12,$H$2:$L$7,4,FALSE),E12<VLOOKUP(A12,$H$2:$L$7,5,FALSE)),"Yes","No"))
Each VLOOKUP pulls the limit for whichever test is picked in A12, and AND only gives Yes when all four checks pass. The outer IF leaves F blank until a test is chosen. Copy it down the column.
We tried it on your numbers: 0.08 in B passes Test A but fails Test B (minimum 0.09), which is the switch you're after. If one of the other tests needs a check the other way round (a maximum in B, say), give it its own column in the table rather than another IF. Also, your post has C at > 0.5 in one place and >= 0.5 in another; change >= to > if a result of exactly 0.5 should fail.
(Drafted with AI assistance; formulas tested before posting.)