问题
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