Matching two lists of IDs

whlte

New Member
Joined
Mar 15, 2016
Messages
2
Hey guys I'm not that good at excel. Normally I can work around the formulas but this time it has not been working out.

I have two lists of ID which are very similar but yet not the same. Around 2200 values.

Example
ID1 ID2 Sex
1 1 Male
2 3 Female
3 4 Male
4 6 Female
6 7 Male
8 10 Female
The "Sex" is matched to ID2.

What I would like.

ID1 ID 2 Sex
1 1 Male
2
3 3 Female
4 4 Male
6 6 Female
7 Male
8

The IDs are arranged in ascending order but are not continuous.

Anyone knows what I can do?
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Assume ID1 is in column A, ID2 is in column B, Sex is in column C, all data columns have a single header row, so that first actual data is on row 2, with a total of 100 rows of data.

=iferror(vlookup(a2,b$2:c$101,1,false),"")
should match ID2s with ID1s

=iferror(vlookup(a2,b$2:c$101,2,false),"")
should bring the sex across.

Assumes you are using a newer version of Excel which has the iferror() function. If not, there are ways round this.
 
Last edited:
Upvote 0
Gerald,

Thanks for your quick reply. It works in getting the data sorted. But I actually needed to retain the rows such that I can reintroduce the lists back into other sheets(where it came from) so I did it manually. The list I got matched the data from the formula you have so thanks anyway.
 
Upvote 0

Forum statistics

Threads
1,215,401
Messages
6,124,705
Members
449,182
Latest member
mrlanc20

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