How to Split a single cell into multiple rows and add another row

后端 未结 3 968
无人共我
无人共我 2020-12-02 01:17

I have a table that has two Columns. Date and Test Name. What I would like to happen is that the string of text in one single cell be separated into multiple rows. In additi

3条回答
  •  感动是毒
    2020-12-02 01:44

    A formula solution is close to your requirement.

    Image shown here.

    Cell H1 is the delimiter. In this case a space.

    Helper E1:=SUM(E1,LEN(B1)-LEN(SUBSTITUTE(B1,$H$1,"")))+1
    

    You must fill the above formula one row more.

    A8:=a1
    

    Fill this formula to the right.

    A9:=LOOKUP(ROW(1:1),$E:$E,A:A)
    

    Fill this formula to the right and then down.

    B9:=MID($H$1&LOOKUP(ROW(A1),E:E,B:B)&$H$1,FIND("艹",SUBSTITUTE($H$1&LOOKUP(ROW(A1),E:E,B:B)&$H$1,$H$1,"艹",ROW(A2)-LOOKUP(ROW(A1),E:E)))+1,FIND("艹",SUBSTITUTE($H$1&LOOKUP(ROW(A1),E:E,B:B)&$H$1,$H$1,"艹",ROW(A2)-LOOKUP(ROW(A1),E:E)+1))-FIND("艹",SUBSTITUTE($H$1&LOOKUP(ROW(A1),E:E,B:B)&$H$1,$H$1,"艹",ROW(A2)-LOOKUP(ROW(A1),E:E)))-1)
    

    Fill down.

    Bug:

    Date/time will be converted to value and blank will be filled with 0. You can add &"" to the end of the formula of A9 and B9 to block the value 0, but numbers/date/time will be converted to text.

提交回复
热议问题