Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have 2 excel documents with a lot of data (near 20.000 columns) and I have to do the following:

Col 1 - Col 2 - Col 3 - Col 4

A - 1 - B - 2
B - 2 - F - 
C - 3 - G - 
D - 4 - H - 
E - 5 - A - 1
.....
.....

In the example above, in the cell next to B (column 3) should print 2 and in the cell next to A should print 1 SO i have to scan columns 1 and 3 for matching, then when cells match print in column 4 whats in column 2

I should note that all cells are text

share|improve this question

1 Answer 1

Assuming that Col 1 is column A, etc, and the data starts in row 2, put this formula in cell D2 and copy down.

=iferror(vlookup(C2,$A$1:$B$50000,2,false),"")

IFERROR() exists in Excel 2007 and later. For earlier versions use

=if(iserror(match(C2,$A$1:$A$50000,0)),"",vlookup(C2,$A$1:$B$50000,2,false))
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.