excel merge rows based on column values

青春壹個敷衍的年華 提交于 2019-12-11 06:40:04

问题


So I've been searching for the information I need and have not really been able to find a simple solution, though it seems like there should be one. Basically, I have the following

John | Doe | 123 Wallaby Ln | 00123 | | |

John | Doe | | 00123 | xxx | yy |

Jane | Doe | | 01234 | | zz |

Jane | Doe | bleep blop ln | | xx | |

And I need

John | Doe | 123 Wallaby Ln | 00123 | xxx| yy |

Jane | Doe | bleep blop ln | 01234 | xx | zz |

Basically pretty simple, I need to merge cells with the same Column 1 & Column 2 data to get as comprehensive and concise a list of data. You'd think this would be readily available through google as a simple formula but I have only found VBA solutions (I have never used VBA before, or macros for that matter so I'm not sure how to use them or fix errors in them). Any help is greatly appreciated.

Thanks in advance!


回答1:


The easiest option is to merge the content of A & B in one column ( insert a new column in C)

C1    =A1&" "&B1

Roll down the formula

Sort per column C

Make sure you have descriptive name on row 1 to describe your column.

Select the complete table

Create a pivot table, drop the C column in the row section to obtain the list of unique name.

Copy the list of unique names in a new sheet

and then look at vlookupall describe here excel vlookup with multiple results to create your own function.



来源:https://stackoverflow.com/questions/10938626/excel-merge-rows-based-on-column-values

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