Excel concatenate

自古美人都是妖i 提交于 2019-12-29 09:24:26

问题


I would like to concatenate data from two cells into one cell. I would also like to only combine those cells that have the same ID.

Task ID Name

4355.2 Participant

4355.2 Leader

4462.1 Online

4462.1 Quick

4597.1 Slide

4597.1 One Page

4597.1 One Topic

For example, for this, I would like a cell for 4355.2 with "Participant, Leader" as the data in that cell. The same type of data for 4462.1 with "Online and Quick" as the data for that cell.

Task ID Name

4355.2 Participant, Leader

Is there a way to do that in Excel?

4462.1 Online, Quick


回答1:


Assuming your data is in A1:B8, and sorted.

in C2, =IF(OR(A2>A1,A1="Task ID"),B2,C1&", "&B2), and copy this down to the end of the data
Copy column A to column D, and remove duplicates (tell excel not to expand the selection)
In E2, =INDEX(C:C,MATCH(D2,A:A),1) and copy this down to the end of the de-duplicated data in column D



来源:https://stackoverflow.com/questions/11195148/excel-concatenate

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