How to add "," between returned results

I'm using the below formula to pull all TR numbers (TRnumber) associated with specific IDs (LIMSID) from my master spreadsheet, but I'm not sure how to add a "," between each TR#. All suggestions appreciated!

Thanks!

=IF(ISBLANK(JOIN(DISTINCT(COLLECT({TRnumber}, {LIMSID}, [LIMS ID]@row)), CHAR(10))), "", JOIN(DISTINCT(COLLECT({TRnumber}, {LIMSID}, [LIMS ID]@row)), CHAR(10)))


Best Answer

  • Brian_Richardson
    Brian_Richardson Overachievers Alumni
    Answer ✓

    Looks like you're already using JOIN to pull them together. Instead of using CHAR(10) put "," instead in the tail end of your JOIN.

    =IF(ISBLANK(JOIN(DISTINCT(COLLECT([TR#]:[TR#], [LIMS IDs]:[LIMS IDs], [LIMS ID]@row)), ",")), "", JOIN(DISTINCT(COLLECT([TR#]:[TR#], [LIMS IDs]:[LIMS IDs], [LIMS ID]@row)), ","))


    BRIAN RICHARDSON | PMO TOOLS AND RESOURCES | HE|HIM

    SEATTLE WA, USA

    IRON MOUNTAIN

Answers

  • Kleerfyre
    Kleerfyre ✭✭✭✭✭✭

    So you already have it doing a space, just add the , to the space in the "". It would look like this: ", ". See if that works for you.

    Jonathan Sanders, CSM

    "Change is always scary because it is unknown, but facing the unknown is what makes us stronger."

  • Brian_Richardson
    Brian_Richardson Overachievers Alumni
    Answer ✓

    Looks like you're already using JOIN to pull them together. Instead of using CHAR(10) put "," instead in the tail end of your JOIN.

    =IF(ISBLANK(JOIN(DISTINCT(COLLECT([TR#]:[TR#], [LIMS IDs]:[LIMS IDs], [LIMS ID]@row)), ",")), "", JOIN(DISTINCT(COLLECT([TR#]:[TR#], [LIMS IDs]:[LIMS IDs], [LIMS ID]@row)), ","))


    BRIAN RICHARDSON | PMO TOOLS AND RESOURCES | HE|HIM

    SEATTLE WA, USA

    IRON MOUNTAIN

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭

    That CHAR(10) delimiter in your original formula is a line break. If you use the wrap text feature with your original formula, each TR# will be on its own line (within the same cell).

    Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!

    CERTIFIED SMARTSHEET PLATINUM PARTNER

    10xViz.com

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!