'IF Function with multiple true values
Solution 1:[1]
If you are wanting to select a random value from column B, C or D you can use the INDEX and RANDBETWEEN functions along with an IF
=IF(A1=1,INDEX(B1:D1,RANDBETWEEN(1,3)),"")
You would then just need to extend the formula to the bottom of your data
Solution 2:[2]
Is it possible to have multiple 'values_if_true'
yes and its called "nesting". example:
=IF(A2=1, IF(B2="apple", "x", "y"), "z")
further, you may place another nested if-statement instead x
, y
or z
on your example it is not clear how you want to alternate between apple
and pear
- there are several options (random, predetermined, alternating)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | A.Steer |
Solution 2 |