简体   繁体   中英

Merge excel rows based on other column values?

I'd like to do the following with VBA or just excels standard merge options if possible:

I have the following 3 columns: https://i.imgur.com/TDdNxoq.png

I what I want to do is to check whether the content of column A and B is identical, then merge both rows into one and comma separate the values in column C:

https://i.imgur.com/eGm6Uj9.png

How can I do this?

I had to do something similar a while ago. Here are the steps:

1) formula in column D:

= IF (A1=B1, CONCATENATE(C1, ",", C2), "")

2) apply a filter on column D for blank cells

3) delete all rows that have blank column D

4) remove filter

5) delete column C

Note: This is only efficient for "one time use" situations. If you need to do this often, developing a macro may be more efficient.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM