• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Extracting second last data (Delimiter)

Hi All,

Needed help ... I tried LEFT, RIGHT, TEXTBEFORE and TEXTAFTER...but nothing worked


InputOutput
Jagdish,Sreedhar,Vanaja,ShettyVanaja


In this the input is a text string seperated by (,) and I want to extract the second last word which is mentioned in the Output column.

The actual data is with almost 17-18 delimiters, but to make it simple I made this simple example above.

Can anybody please help me with this....


Thanks in advance,
Jagdish
 
i'm sure there is an easier way then this
=DROP(TAKE(TEXTSPLIT(A2,","),,-2),,-1)

this splits the cell
then takes the last 2 items
and drops the last 1
so you get 2nd to last
 
=TAKE(DROP(TEXTSPLIT(A1,","),,-1),,-1)
or
=LET(a,TEXTSPLIT(A1,","),INDEX(a,COUNTA(a)-1))
 
Last edited:
Back
Top