Formulas can only modify their own output. They can’t affect the contents of a multiple-select field, so the best you can do is create plain text.
Extending the formula from looking at one checkbox to looking at five is a matter of concatenating each output with the one before it using the &
operator. The question then becomes, “How do we add separators (commas) without ending up with things like this?”
, , Sat Eve, ,
The answer is: add the commas last.
Here’s the test I made, copying your setup as closely as I could:
Here’s my formula:
SUBSTITUTE(TRIM(IF({Sat AM}, "Sat AM") & IF({Sat PM}, " Sat PM") & IF({Sat Eve}, " Sat Eve") & IF({Sun AM}, " Sun AM") & IF({Sun PM}, " Sun PM")), " ", ", ")
From the inside out, there are three things going on:
- I’m adding each label only if the associated checkbox is checked. Each option (except for the first one) begins with two spaces. This serves to help with both #2 and #3.
- I then trim the result, which gets rid of any leading spaces (for cases where “Sat AM” isn’t the first checked option), leaving only the double-space gaps between any items.
- I replace all instances of double spaces with a comma and space.