Explanation

The CHOOSE function provides the framework for this formula.

When this formula is copied down, it will return one of the four colors.

Note that RANDBETWEEN will calculate a new value whenever the worksheet is changed.

Excel formula: Random number between two numbers

The values provided to CHOOSE can include references.

RANDBETWEEN Function

The Excel RANDBETWEEN function returns a random integer between two given numbers.

RANDBETWEEN recalculates each time a worksheet is opened or changed.

Excel formula: Random date between two dates

Excel formula: Random value from list or table

Excel CHOOSE function

Excel RANDBETWEEN function