Help

Re: Checkboxes and a formula : Is there a way to...?

1331 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Ptt_Pch
8 - Airtable Astronomer
8 - Airtable Astronomer

I’m feeling very ashamed of myself for asking (because I’m pretty sure I’m just missing something very simple, as it often happens to me :grinning_face_with_sweat: )…

The situation is :
On one of my [Table], I’ve got 7 checkboxes : {Day 1}, {Day 2}, {Day 3}, {Day 4}, {Day 5}, {Day 6}, {Day 7}.

These checkboxes are just meant to tell me is something is happening that day (Checkbox= checked) or not (Checkbox= unchecked).
Nothing to fancy there :winking_face: .

What I want to do, is creating another field on the same [Table] that could tell me what {Day} has been checked.

For example:
If {Day 1}, {Day 2} and {Day 5} have been checked, this field (let’s call it {Days}) would tell me something like :
=> {Days} : {Day 1},{Day 2},{Day 5}

I’ve searched and quickly found Using checkbox fields in formulas in the Airtable Support which is pretty simple and works if there is only one checkbox.

IF({Day 1}=1,"Day 1","")

What I’m not able to do, is to find the right formula that could put together all the IF()

IF({Day 1}=1,"Day 1","")
IF({Day 2}=1,"Day 2","")
IF({Day 3}=1,"Day 3","")
IF({Day 4}=1,"Day 4","")
[Etc...]

I thought of using an ARRAJOIN() function, but well, I’m just stuck there… :sweat:

Can someone guide me through this ? :slightly_smiling_face:

Thank you very much in advance :grinning_face_with_smiling_eyes: :thumbs_up: !

2 Replies 2

Guess what @Ptt_Pch… you can use conditionals in the midst of a concatenation! I’ll not give you the whole formula, for time’s sake, but it should be enough for you to see what’s going on and finish it out:

IF({Day 1} = 1, "Day 1, ") &
IF({Day 2} = 1, "Day 2, ") &
...

Another way to do that is:

CONCATENATE(
   IF({Day 1} = 1, "Day 1, "),
   IF({Day 2} = 1, "Day 2, "),
   ...
   )

Make sure you have the space after the comma inside the string each conditional produces (except for the “Day 7” one, which will have no comma) for proper spacing.

Thank you very much @Jeremy_Oglesby :slightly_smiling_face: :thumbs_up:

That’s exactly what I was looking for but couldn’t find :grinning_face_with_sweat: !