Taking Two columns and doing matching with Phone Numbers

lizardbreath

Board Regular
Joined
Feb 23, 2012
Messages
54
Hello Mr Excel Wizards,

I have been trying to figure this out and have been unable to do so on my end. I have two columns in a spreadsheet.

Column A - A unique Identifier for a record
Column B - The phone number for the record

What I am trying to do is sort the records based on the phone number, then the Id (Id from Greatest to Least). After doing the sort, Column B will have the phone numbers in a list with any duplicate numbers one on top of the other.

Here is where it gets tricky,

I want to take the Ids that are below the highest Id of the phone number set (There could be several records with the same phone #), and then match it against the Id that is the highest number of that phone number set.

Here is an example set of data that I can get from sorting the information on the spreadsheet.

IdentifierPhone Number
81111111111
71111111111
61111111111
52222222222
42222222222
34444444444
24444444444

<colgroup><col><col></colgroup><tbody>
</tbody>

Here is what I would want to be spit out from the example set of data. Basically the way our CRM is designed is that it can take records and merge them on the back-end of other records if they are duplicates. So I need to take the older records (The lower numbers) of the phone number set and match it against the higher Ids of that phone number set.

DupRecordIdParentRecordId
78
68
45
23

<colgroup><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
So, you want a list of all the duplicate phone numbers and the ID they are duplicated by? I would copy all data to the place you want to create that list and sort column A (ID) as Largest to Smallest. Then, input this formula into cell C3:
Code:
=IFERROR(INDEX($A$2:A2,MATCH(B3,$B$2:B2,0)),"")
Use the fill handle to drag the formula down to the bottom of the data (or just double click the fill handle). The formula will input the ID of the highest matching phone number. You can then copy/paste special: values, sort column C and delete out rows that contain a blank value in column C.

If this would be a repeatable process, I would have the macro do mostly those exact steps.
 
Upvote 0

Forum statistics

Threads
1,214,545
Messages
6,120,132
Members
448,947
Latest member
test111

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top