How to Write Formula that Concatenates with Conditional Commas

I am stuck on something that shouldn’t be as hard as I’m making it.
I have several formula fields in my base that are calculating dates based on a # of days entered. I want to put all of these dates together - but I’m having a minor issue. Some projects have 1 date, others have 3 - up to 4 potential dates that need to be concatenated. I have a simple formula written that concatenates them "IF( {FP 1st}, CONCATENATE({FP 1st}, ", ",{Fp 2nd}, ", ",{Fp 3rd}, ", “, {FP 4th}))” - so if the FP 1st isn’t blank, put all of the values together. The issue I’m having is that for the projects that don’t have FP 2nd or higher, I’m still getting the commas. Normally this isn’t a big issue, but this field is going on a shared view for clients. Is there a way to write an IF formula to tackle this? Or set it up differently and try to run an array formula on this field?

Just thinking out loud here, but what if you tested it backwards? If the FP 4th field isn’t blank, concatenate them all, if it is blank, look to FP 3rd and do the same thing but only concatenate the FP 1st, 2nd & 3rd, etc.

That worked! Well, once I got all of my commas in the right place it did. Thank you!

1 Like

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.