Use JOIN/COLLECT to return the first x number of characters

I am using JOIN/COLLECT to return a list of items matching a criteria is a separate sheet. Items are returned in a single cell. The formula I'm using is:

=JOIN(COLLECT({Item Number}, {Date_Complete_Helper}, ="No", {ExtTestHelper}, ="No"), SUBSTITUTE(Lots39, "-", ""))

(the substitute is used to provide a line break between each returned item within the cell)

I would like to keep only the first 3 characters of each returned entry. For example, I want List 1 (below) to look like List 2 (below):

List 1:

Apple

Dog

It

Faster

List 2:

App

Dog

It

Fas

I can't get the LEFT function to work here. The formula won't parse if LEFT encloses COLLECT, and if I use LEFT to enclose the entire function, I only get the first characters of the first line (which makes sense, but I thought I would try). Any thoughts? I know I could create a helper column for {Item Number} but I'm doing this for many many columns and I'd rather not muddy that sheet up. I'd rather use a formula.

Best Answers

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    Answer ✓

    Hi Lucas,

    I don't think it can be done with just a formula. You need LEFT and it doesn't work inside COLLECT, as you already found.

    I'm curious to see if someone else can find a very creative solution to your puzzle.

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

  • Paul Newcome
    Paul Newcome Community Champion
    Answer ✓

    A couple of notes...


    When I have helper columns that I don't want cluttering up the sheet, I move them to the far right and then "Hide" them. They will still function the same way, but they aren't visible.


    The function to insert a line break without having to use that reference cell is CHAR(10).

    =JOIN(COLLECT(.........................), CHAR(10))



    Finally... There are ways to parse data out based on a delimiter across multiple columns in a single row (helper columns that can be hidden). The setup is a little tedious, but it can be done and will operate rather smoothly once it is setup. Your particular situation would require taking the parsing formulas and just wrapping them in the LEFT function then finally joining them back together in your displayed column. If you would be interested in that solution, let me know. I'd have to do some digging into my notes, but I know it is out there somewhere.

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!