Extract the first word from a cell

Hi,

In 1 column I have a string that has 1 word then 2 or more words after that, how do I extract from the column the first word only?

In excel I'd use the following

=TRIM(LEFT(A2, FIND("^",SUBSTITUTE(A2, " ", "^",1)&"^")))

In Smartsheet there's no TRIM..

The below formula returns the value of the first and second word,

=LEFT([Column Test]@row, (FIND(" ", [Column Test]@row) - 0))

Best Answers

  • Andrée Starå
    Andrée Starå ✭✭✭✭✭✭
    Answer ✓

    Hi @A Rose @L_123

    I hope you're well and safe!

    Wohoo! I think I solved it!

    Try something like this.

    =LEFT(ColumnName@row, (FIND(UNICHAR(9), ColumnName@row)))

    Did that work/help?

    I hope that helps!

    Be safe and have a fantastic week!

    Best,

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

    Did my post(s) help or answer your question or solve your problem? Please support the Community by marking it Insightful/Vote Up, Awesome, or/and as the accepted answer. It will make it easier for others to find a solution or help to answer!

  • L_123
    L_123 ✭✭✭✭✭✭
    Answer ✓

    You can use the one I gave you earlier, just switch the 10 to a 9

    =LEFT([Column Test]@row, FIND(" ", substitute([Column Test]@row,CHAR(9)," ")) - 1

  • L_123
    L_123 ✭✭✭✭✭✭
    edited 08/16/22 Answer ✓

    It's a coding/encoding issue. So when you see characters in a digital environment, the environment doesn't typically see the characters themselves, they see an encoded representation of the character. Different datasets can be encoded with different rules and schemes, though a lot of them are very similar to each other. Common encoding schemes would be ANSI, UTF-8, UTF-16.

    In these coding schemes, something visually represented one way, can actually have different meanings in the background to the software. Space is one that is used very often. A good example of this functionality would be the initial one that I suggested might be your problem char(10). char(10) or carriage return is a version of a space, that also tells the software to put the next information on the next line of data. If you don't have this functionality allowed (i.e. wrap text), it will simply appear as a space.

    So the spaces have some added background functionality through the encoding(intended or not, and used or not) in the initial software, that isn't being used by smartsheet, or being allowed to be used by smartsheet by some formatting setting.

    If you really want to figure out what the functionality is, you can look into char(9) or more commonly U0009 (thanks @Andrée Starå) and see what it is supposed to do. It could be something as simple as representing a single space as 5

«13

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!