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
This might be a little overkill but here is a nice function that will do what you want... (note if you copy this multiline formula you must paste it directly into the formula bar or into a cell while in edit mode, if you only select a cell and click paste the lines will spill onto other cells)
=LET(in,A56:E62,table,A51:E52,
test, TAKE(in,,1),
data, DROP(in,,1),
luTest, TAKE(table,,1),
luData, DROP(table,,1),
testset, CHOOSEROWS(luData,XMATCH(test,luTest)),
BYROW(MAP(data,testset,LAMBDA(a,b,COUNTIF(a,b))),PRODUCT))and here it is tested in a sheet. I have a lookup table for what the TEST limits are INCLUDING the >,<,>=,<= conditionals and then pass them to a COUNTIF to interpret those conditionals and use PRODUCT to make sure all of them pass. Below shows the lookup table in A50:E52 (i.e. your 2 tests A & B but could include many more) and the rows of test data in A55:E62 and then the formula is in F56 and spills down the column for every row in the test set:
so how it works is in row 1 is the input for the data to test (in) and the lookup table (table),
then rows 2-5 just break it up into data vs lookup test names
then row 6 will create a table of lookup values based on the test names chosen
then row 7 does the comparison using MAP to pass each data value with the corresponding condition to the COUNTIF and then do the PRODUCT across each row.