How to concatenate cell (row wise) in excel till a value is found?

╄→гoц情女王★ 提交于 2021-01-29 17:58:24

问题


I have data in MS excel sheet as :

Row     Column A
1   AAA Number of ABC
2   Streaming Call
3   Explanation
4   BBB Number of ABC
5   Streaming Call
6   from source
7   Explanation
8   CCC Number of ABC
9   Streaming Call
10  from source
11  to Dest
12  Explanation
...
...
196000  Explanation

I want to keep concatenating cell of column A in column B, till the cell value is "Explanation" :

1   AAA Number of ABC   AAA Number of ABC
2   Streaming Call          AAA Number of ABC Streaming Call
3   Explanation         Explanation
4   BBB Number of ABC   BBB Number of ABC
5   Streaming Call          BBB Number of ABC Streaming Call
6   from source         BBB Number of ABC Streaming Call from source
7   Explanation         Explanation
8   CCC Number of ABC   CCC Number of ABC
9   Streaming Call          CCC Number of ABC Streaming Call
10  from source         CCC Number of ABC Streaming Call from source
11  to Dest                 CCC Number of ABC Streaming Call from source to Dest
12  Explanation         Explanation
...
....

Can somebody suggest me formula that I can paste in Column B and drag to get desired result?

Thanks in advance.


回答1:


Reluctant to just write code for you, but it's an easy one so why not... Put in B2:

=IF(ROW()=1,A2,IF(A2="Explanation","Explanation",CONCATENATE(IF(A1="Explanation","",B1),A2)))

Drag up and down.



来源:https://stackoverflow.com/questions/20614441/how-to-concatenate-cell-row-wise-in-excel-till-a-value-is-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!