Reduce number of cells in Excel

后端 未结 3 1145
礼貌的吻别
礼貌的吻别 2021-01-22 23:49

I have a spreadsheet managing a list of groups in time slots. Imagine the below are cells:

0830-0845, Bob Hoskins, Jack Table, Phil Cup
0845-0900, Bob Hoskins, J         


        
3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-22 23:52

    Assuming your data starts in A2. Parse your input as Fixed Width to isolate the - and the first ,. Select Text for the first and third columns. Format the sheet as General. In D2 put:

    =IF(E1<>E2,"S",IF(E2<>E3,"F",""))  
    

    and copy down to suit.

    Copy ColumnD, Paste Special, Values over the top and delete rows with blanks in Column D. In B2 put:

    =IF(AND(D2="S",D3="F"),A2&"-"&C3,IF(D2="S",A2&"-"&C2,""))  
    

    and copy down to suit.

    Copy ColumnB, Paste Special, Values over the top and delete rows with blanks in Column B. In A2 put =B2&", "&E2 and copy down to suit. Copy ColumnA, Paste Special, Values over the top.

    Delete all but ColumnA.

提交回复
热议问题