Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Merging two records into one in Excel

Posted on 2014-10-20
7
141 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

With the internet and the ease of information transference, many professional jobs can be done anywhere today.  Why should it make a difference whether an x-ray is read in India or the United States as long as the radiologist is qualified?   Outso…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

792 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