Share via

Combine data between rows with duplicate values in multiple columns, using a primary key

Anonymous
2019-01-04T13:12:42+00:00

Hi there,

I've search for a solution but no luck until now.

I have a client table with multiple duplicates (24000 rows..) from different sources and need to combine them.

For example:

SocialNum Name Citizen Email
654654 john doe 13513513 ******@company.com
654654 john mid doe ******@company.com

What I'm trying to achieve is a way to select the row that has more data available (more cells filled and not blank) and use it for a new table, using the "SocialNum" ID as the validation for duplicates.

So I would get:

SocialNum Name Citizen Email
654654 john doe 13513513 ******@company.com

If there are two duplicate rows with the same amount of data, copy the first one.

Also if in 10 possible fields (columns) one row has 9 and the other row also has 9 but are blank on different fields, select the first one and combine the blank information with data from the other row.

Example:

SocialNum Name Citizen Email field5 field6
654654 john doe 13513513 ******@company.com has
654654 João Meijinhos ******@company.com has also

Would get:

SocialNum Name Citizen Email field5 field6
654654 john doe 13513513 ******@company.com has also

Is this possible?

Thank you!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Lz365 38,201 Reputation points Volunteer Moderator
    2019-01-08T22:09:10+00:00

    Hi Joao

    A few days has elapsed. No news. What does this mean?

    Was this answer helpful?

    0 comments No comments
  2. Lz365 38,201 Reputation points Volunteer Moderator
    2019-01-04T17:44:53+00:00

    Hi Joao

    With Get & Transform aka Power Query

    If not exactly what you want that shouldn't be far. Sample avail. here:

    • Copy/paste your data in Table1
    • Switch to Sheet2
    • Right-click somewhere in the green table > Refresh (might take a bit of time with 24k rows...)

    Only mandatory column name is the first (SocialNum). All others can be renamed at your convenience

    Was this answer helpful?

    0 comments No comments
  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more