Forum Discussion

apei78759's avatar
apei78759
Copper Contributor
May 25, 2022

Manipulate text between delimiters

How can I covert following: 78756||23456||12345

To: 787||234||123

 

I want the first 3 digits 

4 Replies

    • apei78759's avatar
      apei78759
      Copper Contributor
      Thank you! This works for string for 3 entries: 78756||23456||12345

      But how about something that works regardless of the number of entries. For example, 5

      78756||23456||12345||34567||09685
      • Detlef_Lewin's avatar
        Detlef_Lewin
        Silver Contributor

        apei78759 

        Try this.

        =TEXTJOIN("||",TRUE,LEFT(FILTERXML("<y><z>"&SUBSTITUTE(A1,"||","</z><z>")&"</z></y>","//z"),3))

Resources