unwanted break in formula which references another sheet

OshaK
OshaK ✭✭✭✭✭
edited 10/18/24 in Formulas and Functions

I use this formula to combine mutlipe dates and notes into a single string to display them by month. the dates/notes are in a separate sheet.

the formula example is (where 'Davis October' changes depending on the last name/current month)

="October " + Year1 + CHAR(10) + IF(COUNT(DISTINCT(COLLECT({Davis October}, {Davis October}, <>""))) > 0, JOIN(DISTINCT(COLLECT({Davis October}, {Davis October}, <>"")), ", "), "")

the formula looks at the column called "Dates & Reasons" in another sheet where it combines Dates and Reasons to be away like so:

=IF(AND(Helper@row <> "", [Reason(s) to Be Away]@row <> ""), Helper@row + ":" + [Reason(s) to Be Away]@row, IF(Helper@row <> "", Helper@row, IF([Reason(s) to Be Away]@row <> "", [Reason(s) to Be Away]@row, "")))

the output in the external sheet in that column looks like (no breaks and no other than ":" punctuation)

However, in my main sheet, once a set of rows is selected and referenced by "Davis October" I get the breaks between the dates and a comma, new dates, break for the following dates.

How can i make it to display:

October 2024:
24-26: Domestic Conference
29-31: PTO/Vacation

with no breaks and no comma? I don't have any of those in the reference sheet formula

(please ignore September as it's in the separate cell. Also, the screenshots are from two different people, so they don't match, but i see this for all of them).
thank you so much!

Answers

  • Kerry St. Thomas
    Kerry St. Thomas ✭✭✭✭✭✭

    It appears the comma is being added by the JOIN clause of your first formula above. The reason for the soft line break is the width of your column - so if instead of the ", " in that formula you replace it with CHAR(10) the JOIN will insert a line feed - one press of the return key - instead of the comma. You'll also need to investigate how "Domestic Conference" was entered - is that a nonbreaking space? When you have done that troubleshooting, using the CHAR(10) break should allow you to resize your column and turn off the text wrap for the column to get closer to the format you're aiming for.

    If this answer resolves your question, please help the Community by marking it as an accepted answer. I'd also be grateful for your response - "Insightful"or "Awesome" reactions are much appreciated. Thanks!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!