Forum Discussion

Alias17754's avatar
Alias17754
Copper Contributor
May 24, 2022

Adding if formulas together for specific text combinations

Help please. I need a formula to return specific text based off two selections. i can get the first formula to work but can’t get the varaitions to work based on a combination of high, med and low selections. Always returning the lowest selected. 

If column 1 = “high” and column 2 = “high”then the answer is high. 

plus 

 

if(cell=“high”,if(cell=“med”,”med”) 

 

plus if(cell=“med”,if(cell=“med”,”med”) 

 

and so on. 

appreciate any support.  

 

1 Reply

  • mtarler's avatar
    mtarler
    Silver Contributor
    It would help if you gave more actual details but since you didn't all I can say is there are 3 (and likely more) functions to look at:
    1) the IF() statement, which I suppose you already know. You can 'chain' IF statements together:
    =IF( AND(a1="high", b1="high"), "high-high result", IF ( AND(a1="high", b1="med"), "High-med result", ...) )
    In the above example I show if a condition is true then it gives that result but if false it 'falls' into the next IF() statement. You could just as easily chain on the TRUE condition side also or instead.
    2) the IFS() statement, this is just like the IF() statement but you don't have to keep repeating the IF and don't have to count the "( )":
    =IFS( AND(a1="high", b1="high"), "high-high result", AND(a1="high", b1="med"), "High-med result", ... , TRUE, "default output" )
    note the last pair I use TRUE so anything that didn't pass a prior condition will get the "default output" result
    3) SWITCH() statement will take ONE input and then 'switch' the output based on it. So for example:
    =SWITCH( a1 & b1, "highhigh", "high-high result", "highmed", "high-med result", ....)
    In this example I text joined the values from a1 and b1 to create a single text value to do the comparison.
    there are many other ways you can 'play' with those functions and many other functions but hopefully that helps.

Resources