Solved

Merging two records into one in Excel

Posted on 2014-10-20
7
137 Views
Last Modified: 2014-11-03
I have a spreadsheet that contains demographic data.  I need help!  What I'd like to do is merge two rows that contain the same last name and address.  The problem right now is there are two records per provider, and one has a image rec field complete, and the other has the tax id.  I need one record that has both.  In the attached file, the top four rows are the "as is" state, and the bottom two rows are what I'd like it to look like.
Merge-Example.xlsx
0
Comment
Question by:paxtonm
  • 4
  • 3
7 Comments
 
LVL 27

Expert Comment

by:Glenn Ray
ID: 40392705
It appears that the data containing the Tax ID is the preferred data and that you only need to populate the IMAGE_RECNBR field.  These steps should work:

1) Create a duplicate copy of your existing worksheet (either [Ctrl]+click-and-drag the sheet tab to a new location or, right-click sheet tab, select "Move or copy...", select (move to end) and click OK)
2) Rename the sheet - say, "Combined"
3) Remove all rows containing a value in the IMAGE_RECNBR field:
    a) Turn on Data Filters (Menu: Data, Sort & Filter section, Filter icon)
    b) Click on filter button for IMAGE_RECNBR field and turn OFF the check box for (Blanks).
    c) Select all visible rows, right-click on selection and click "Delete Rows".
    d) Clear the data filters (Menu: Data, Sort & Filter section, "Clear")
4) In cell D2 (which should be empty), enter the following formula:
=SUMIF(Sheet1!A:A,A2,Sheet1!D:D)  <---replace Sheet1 with your original sheet name
5) Copy down this formula to the bottom of your remaining data.
6) Select all these cells (D2 to bottom), copy again and replace with their values (PasteSpecial, values).

This presumes that there are only two records per individual and that only one record in each pair contains the IMAGE_RECNBR value.

Regards,
-Glenn
EE-Merge-Example.xlsx
0
 

Author Comment

by:paxtonm
ID: 40397659
Glenn,

This worked in some instances, and not in others.  I think this is because there are some Drs. with multiple locations and TaxIDs and ImageRecNmbr.  I have attached a more representative sample.

Thanks,

Michael
Merge-Example-2.xlsx
0
 
LVL 27

Expert Comment

by:Glenn Ray
ID: 40398008
In your example data, only four records would be consolidated:
consolidationand the rest would be unaffected.  Is this correct?

-Glenn
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:paxtonm
ID: 40398362
Correct, and the others should remain with the TaxID field blank.
0
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 500 total points
ID: 40402437
Based on your new example data and your original criteria (last name and address must be the same), here's how you can consolidate the data:

1) [Optional, but recommended] Create a duplicate copy of your existing worksheet (either [Ctrl]+click-and-drag the sheet tab to a new location or, right-click sheet tab, select "Move or copy...", select (move to end) and click OK)
2) Insert a new column to the right of the IMAGE_RECNBR field (in column E).  Enter a new header, like "NEW_IR"
3) Insert this formula in E2 and copy down:
=SUMIFS(D:D,G:G,G2,I:I,I2)
4) Select all these cells (E2 to bottom), copy again and replace with their values (PasteSpecial, values).
5) Remove selected duplicates (Menu: Data, Remove Duplicates)
    a) Click the "Unselect All" button
    b) Select "NEW_IR"
    c) Click the "OK" button.
remove duplicate IR rows6) Delete column D (the old IMAGE_RECNBR column).
7) Change the header in D1 to "IMAGE_RECNBR".

As before, this presumes that there are only two records per individual and that only one record in each pair contains the IMAGE_RECNBR value.

 Regards,
 -Glenn
0
 

Author Comment

by:paxtonm
ID: 40419451
Glenn,

Thanks for going above and beyond in helping me with this issue.  Your solution was great, and far more than could ever be expected.

Thanks again,

Michael
0
 

Author Closing Comment

by:paxtonm
ID: 40419452
Glenn provided a phenomenal solution and was kind and understanding in our back and forth discussions.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
As freelancing is becoming more and more common in the tech industry, certain obstacles are proving to be a challenge to those who are used to more traditional, structured employment. This article is meant to help identify such obstacles and offer a…
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now