Excel - match ID numbers in one column to ID numbers in another column

Column A contains the New ID number.
Column B contains the Old ID number.

In many cases, there are several New ID numbers for one repeated Old ID number.
And several repeated Old ID number for one New ID number.

There are a several long lists of Old ID from different files that need to be matched to New ID.

The concept is that a list of Old ID could be pasted into Column F, and  column E could repeat the same Old ID as often as it appears in Column B with the matching New ID from Column A, shown in column D - manual example shown in file.

Hope this makes sense.
Example-Old-ID-match-New-ID.xlsx
gregfthompsonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Martin LissOlder than dirtCommented:
Could you explain why D3, E3 and F3 have the values they have?
0
gregfthompsonAuthor Commented:
The ID numbers indicate areas on a map.   These areas have now been changed - some Old ID have 2 or more New ID.  Some New ID have 2 or more Old ID.

I'd like to be able to match some lists of Old ID to the New ID numbers. I'll then dedupe the New ID numbers and have a corresponding list that will be close enough.

Column F would be the list of Old ID that would be pasted here.

Column E would be the Old ID from Column F that are matched to Column B (and repeated as often as required)
Column D would be the New ID from Column A, matching the Old  ID in Column E.

I hope this makes sense.

There is very probably a better way to achieve the same result.
0
gregfthompsonAuthor Commented:
Column E would be the Old ID from Column F that are matched to Column B (and repeated as often as required) - as often as it appears in column B.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

Martin LissOlder than dirtCommented:
Sorry it's quite late for me so I'll be back tomorrow if someone else doesn't solve this or you, but what I was asking is specifically why D3 is 1132202 and why E3 and F3 are 1010104.
0
gregfthompsonAuthor Commented:
Sorry. I have not explained the problem very well.

Column F is a copied list of Old ID from another file(s) and pasted here. It is this list that is to be matched with Old ID from Column B, results in Column E.
F3 is the first of the copied and pasted list from another file.

E3 is the matched Old ID for F3 from Column B
E4 is the matched Old ID F4 from Column B

D3 is the matched New ID from Column A that corresponds to the Old ID in Column B that was matched to F3 in Column E.
D4 is the matched New ID from Column A that corresponds to the Old ID in Column B that was matched to F4 in Column E.

It may be best to do this in two separate runs.
1. match contents of Column F to contents of Column B with results in Column  E.

2. Then match contents of column E with contents of Column A with results in Column D.
0
gregfthompsonAuthor Commented:
Operation 2  might be better expressed as
2. Then match contents of column E with contents of Column B and copy corresponding content from Column A into Column D.
0
Martin LissOlder than dirtCommented:
Is a visual basic solution OK?
0
Martin LissOlder than dirtCommented:
While waiting for your reply I started coding step one and got this result which is not the same as yours.
Cursor_and_Microsoft_Excel.jpgWhat I'm doing is searching column "B" for each entry in column "F", and when a match is found, placing the value from column "B" (I guess I could just use the column "F" value since they are the same)  in column "D". Am I doing something wrong?
0
gregfthompsonAuthor Commented:
Visual Basic will be fine.

This result appears to be correct.
0
Martin LissOlder than dirtCommented:
This result appears to be correct.
Please verify that. I ask because what you have in the workbook you posted is this
His.jpgwhich is different.
0
Martin LissOlder than dirtCommented:
See if this is what you want.
29069260.xlsm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gregfthompsonAuthor Commented:
A very BIG thanks.
You are amazing.
0
Martin LissOlder than dirtCommented:
You're welcome and I'm glad I was able to help.

If you expand the “Full Biography” section of my profile you'll find links to some articles I've written that may interest you.

Marty - Microsoft MVP 2009 to 2017
              Experts Exchange MVE 2015
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2017
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.