![How to delete duplicate rows in excel How to delete duplicate rows in excel](/uploads/1/2/5/3/125388458/686849781.jpg)
I have an Excel database and I'm trying avoid doing some manual combining of duplicate data. I've got a bunch of listings that are essentially the same aside from the tags column. What I'd like to have it do is combine these 5 listings into 1 listing, making the categories a comma separated list in a single cell. Turn this into this Is there any way of achieving this? My document has a couple thousand listings, so I'm obviously trying to avoid the manual edit route. I'm an Excel novice, so any hand holding or tutorials you could point me to would be appreciated. This can also be done using formulas.
![Remove Duplicate Rows In Excel For Mac 2011 Remove Duplicate Rows In Excel For Mac 2011](/uploads/1/2/5/3/125388458/616156873.png)
Learn how to remove duplicate data in Microsoft Office Excel 2007. Excel features make it easy to locate duplicates on a spread sheet and then either highlight them or delete them. To remove rows with the same values in certain columns, execute the following steps. For example, remove rows with the same Last Name and Country. Check Last Name and Country and click OK. Excel removes all rows with the same Last Name and Country (blue) except for the first instances found (yellow).
For my example to work, the data would need to be sorted by the first column and there would need to be a header row. You would need two more columns (C & D). First, add a formula that essentially says to concatenate the data in column B if data in column A is the same as the row above it, otherwise reset the concatenation. The next column would contain a formula to identify the final concatenations so you can sort later. This is how I would do it with listings and categories in columns A & B (again, the data would need to be sorted by column A and there would need to be a header row): Here's the results. Now I would copy the entire range and paste values into another sheet. The rows with zero for column D is what I'd want to use.
Sorting by column D would float them to the top. This will (should) generate a new sheet from your source sheet with the duplicates concatenated. To use the following code you need to add it to a new module in the VBA Editor A Shortcut to open the VBA Editor is Alt+F11 (for Windows) and Alt+Fn+F11 (for Mac) Once the Editor is open add a new module by selecting it from the 'insert' menu in the main menu bar.
It should automatically open the module ready to accept code, If not you need to select it (will be named 'ModuleN' where N is the next available number) from the project explorer. I'm not sure if the 'Scripting.Dictionary' is available in osx, but it cant hurt to try.