Formula - Line Breaks

tylermh
tylermh ✭✭✭✭✭✭
edited 12/09/19 in Formulas and Functions

Does anybody know if this post from 3 years ago has been addressed?

https://community.smartsheet.com/discussion/new-line-alt-enter-formulas

I'm looking to concatenate cells with line breaks.  Thanks!

Tags:
«13

Comments

  • Hi Tyler,

    Use the instructions below to add a line break in a string created by formula (using JOIN or "+" symbols)

    1. Create a column called "Helper" and put two dashes separated by a blank line in row 1: 

    -

    -

    2. To use with JOIN, set this function as the delimiter:  "SUBSTITUTE(Helper$1, "-", "")

    3. To use in a manual string,  enter this to add a line break: "+ SUBSTITUTE(Helper$1, "-", "") +"

    Enable word-wrap on any cell where you use this technique.    

    The helper cell can't be deleted.  

    Word wrap must be enabled on cells that use this technique.

  • tylermh
    tylermh ✭✭✭✭✭✭

    Thanks, Kara.  Could I get some screenshots showing the instructions above?  Also, I'm not sure which of the two options would be best for my scenario (either the + symbol or JOIN.

    Thank you!

  • Here you go!

    screencap1.png

    screencap2.png

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    Brilliant! yes

    thinkspi.com

  • Paul,

    What will be brilliant is just doing a UNICHAR(13) ;)

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    I had no idea what that was. I did a little research, and yes. That will be brilliant. wink

    thinkspi.com

  • tylermh
    tylermh ✭✭✭✭✭✭

    Great! But does this work when wanting to "join" different cells within the same row?  I see your example joins Ziggy, Zoey, and Dobby which are rows 1, 2, 3.  I'm looking to create a joined cell with these line breaks you're showing, but for each row with selected data points in separate columns....if that makes sense...see my screenshot showing that my concatenated formula doesn't line break.

    Annotation 2019-05-21 173301.png

  • Andrée Starå
    Andrée Starå ✭✭✭✭✭✭
    edited 05/22/19

    Hi Tyler,

    Try something like this.

    The Double Carriage cell/column would look like below:

    -

    -

    =JOIN([Host Agency Name]@row:[AgencyCountry]@row; SUBSTITUTE([Double Carriage]@row; "-"; ""))

    The same version but with the below changes for your and others convenience.

    =JOIN([Host Agency Name]@row:[AgencyCountry]@row, SUBSTITUTE([Double Carriage]@row, "-", ""))

    Depending on your country you’ll need to exchange the comma to a period and the semi-colon to a comma.

    This should be the result (without the space between the rows):

    Willacy County EMS

    Phone

    693 South 7th

    Raymondville

    TX

    78550

    USA

    Did it work?

    Have a fantastic week!

    Best,

    Andrée Starå

    Workflow Consultant @ Get Done Consulting

    SMARTSHEET EXPERT CONSULTANT & PARTNER

    Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

    W: www.workbold.com | E: [email protected] | P: +46 (0) - 72 - 510 99 35

    Feel free to contact me about help with Smartsheet, integrations, general workflow advice, or something else entirely.

  • tylermh
    tylermh ✭✭✭✭✭✭

    Thanks, Andree, but could you take a look at my screenshot and tell me what I'm missing?

    Annotation 2019-05-22 171935.png

  • Andrée Starå
    Andrée Starå ✭✭✭✭✭✭

    Happy to help!

    Just change the @1 to @row instead. I added @row because then you don't need to think about row numbers.

    Did it work?

    Best,

    Andrée

    SMARTSHEET EXPERT CONSULTANT & PARTNER

    Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

    W: www.workbold.com | E: [email protected] | P: +46 (0) - 72 - 510 99 35

    Feel free to contact me about help with Smartsheet, integrations, general workflow advice, or something else entirely.

  • tylermh
    tylermh ✭✭✭✭✭✭

    Here's another screenshot...still to no avail...

    Annotation 2019-05-23 201805.png

  • Hey Tyler,

    This works: 

    =SUBSTITUTE(Helper$1, "-", "") + [Host Agency Name]@row + SUBSTITUTE(Helper$1, "-", "") + [Host Agency State]@row

    When you add in a state, it will do a line break

     

    tyler.png

  • tylermh
    tylermh ✭✭✭✭✭✭

    SUCCESS!! Thank you so much!

  • Andrée Starå
    Andrée Starå ✭✭✭✭✭✭
    edited 05/24/19

    It should work!

    Are all the columns placed beside each other? Are the column names correct?

    Can you maybe share the sheet(s)? I'd be happy to take a look and see what the problem is. (Delete/replace any confidential/sensitive information before sharing) That would make it easier to help. (share too, [email protected])

    Best,

    Andrée

    SMARTSHEET EXPERT CONSULTANT & PARTNER

    Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

    W: www.workbold.com | E: [email protected] | P: +46 (0) - 72 - 510 99 35

    Feel free to contact me about help with Smartsheet, integrations, general workflow advice, or something else entirely.

  • Andrée Starå
    Andrée Starå ✭✭✭✭✭✭
    edited 05/24/19

    I think I know why it didn't work.

    I didn't see that In your formula you used semi-colons but I think that where you are located it should be as Karas and commas instead. 

    Depending on your country you’ll need to exchange the comma to a period and the semi-colon to a comma.

    Try this one.

    =JOIN([Host Agency Name]@row:[Host Agency State]@row, SUBSTITUTE([Double Carriage]@row, "-", ""))

    Did it work?

     

    SMARTSHEET EXPERT CONSULTANT & PARTNER

    Andrée Starå | Workflow Consultant / CEO @ WORK BOLD

    W: www.workbold.com | E: [email protected] | P: +46 (0) - 72 - 510 99 35

    Feel free to contact me about help with Smartsheet, integrations, general workflow advice, or something else entirely.

Help Article Resources