Excel Automation to Compare Numbers

57 views Asked by At

In one sheet, I have two lists of numbers:

List 1 List 2  
12865 4523  
1239  1392  
5467  3942  
5021  2935  
32012 99945 

and so on...

In a second sheet, I have the same numbers as in List 1 on the first sheet, but in a different order, and a blank second list.

List 1 List 2  
1239  
5467  
12865  
32012  
5021

I know this is a pretty basic problem, but is there a way to automate so excel looks at the numbers in list 1 and populates list 2 based on the matching numbers?

Thank you for any help!

1

There are 1 answers

0
Glen M On

If Sheet1 contains List1 and List2 in the columns A and B and Sheet2 contains List1 in the column A, formula in the Sheet2!B2 can look like this:

=IFERROR(VLOOKUP(Sheet2!A2,Sheet1!A2:B6,2, FALSE),"")

IFERROR filters error values and replace them with blanks

After entering this formula into Sheet2!B2 double click on the fill handle to expand it to all column automatically.