• 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.

Split Text Using Criteria

Kenshin

Member
Have a nice days chandoo.....i desperate have question, please see my file attach



thanks
 

Attachments

  • SPLIT TEXT.xlsx
    9.2 KB · Views: 9
Maybe,

1] Select criteria dropdown list in B3

2] In B7 :

=LEFT($A$1,FIND("@",SUBSTITUTE($A$1," ","@",$B$3))-1)

3] In B8, copied down :

=IFERROR(MID($A$1,FIND("@",SUBSTITUTE($A$1," ","@",$B$3*ROWS($1:1)))+1,MMULT(FIND("@",SUBSTITUTE($A$1," ","@",TRANSPOSE(MMULT(ROW($A1:$A2),1))*$B$3)),{-1;1})-1),"")

Regards
Bosco
 

Attachments

  • SplitCellContent(1).xlsx
    11.5 KB · Views: 11
Last edited:
Hi, tried it in other way, results same as Bosco, but with additional space in the begining from B8

B7:

=LEFT(A1,FIND("@",SUBSTITUTE(A1," ","@",B3)))

B8: (copy to down)
=IFERROR(MID($A$1,SUMPRODUCT(LEN($B$7:B8)),FIND("@",SUBSTITUTE($A$1," ","@",$B$3*(ROW()-6)))-SUMPRODUCT(LEN($B$7:B8))),"")

Regards,
Hareesh
 

Attachments

  • Splitinto3letters.xlsx
    11 KB · Views: 6
Hi ,

Both formulae need to have a minor tweak so that the last couple of words are not missed in the last line :

=IFERROR(MID($A$1 & REPT(" ", $B$3 - 1),FIND("@",SUBSTITUTE($A$1 & REPT(" ", $B$3 - 1)," ","@",$B$3*ROWS($1:1)))+1,MMULT(FIND("@",SUBSTITUTE($A$1 & REPT(" ", $B$3 - 1)," ","@",TRANSPOSE(MMULT(ROW($A1:$A2),1))*$B$3)),{-1;1})-1),"")

Narayan
 
In respect to Narayan's advised to return the last couple of words, here's my fixed formula for just a single formula and shorter.

1] Select criteria dropdown list in B3

2] In B7, copied down :

=TRIM(MID(SUBSTITUTE(" "&A$1," ",REPT(" ",300)),(B$3*ROWS($1:1)-B$3+1)*300,B$3*300))

Remark :

Difference between this formula and Narayan's modified formula :

In the "last line of words", Narayan's modified formula will have trailing spaces and my formula don't have.

Regards
Bosco
 

Attachments

  • SplitCellContent(2).xlsx
    11.2 KB · Views: 3
Last edited:
Back
Top