How to combine columns using Vlookup?

December 2016




Issue


I have 4 columns A, B, C & D (sheet2) Col A got names and B a value for the name in A, Col C names and D values for the names in C. In sht1 i use Cell D7(Sheet1). In D7 is dropdown list with names that is in Sheet2 Col A & C. In Sht1 D21 i want to see the value of name in D7 whether the name is in col A or C on sht2.

A--------------B--------------C------------------D
cable-------401-12-01---bolt-------------403-01-02

So if the name bolt appear in D7, 403-01-02 must be in D21 sht1.

Used the below but i need to combine them!

=VLOOKUP(D7,Sheet2!A2:B164,2,FALSE)
=Vlookup(D7,Sheet2!C2:D164,2,FALSE)

Solution


Try this:
=IF(ISERROR(VLOOKUP(D7,Sheet2!A2:B164,2,FALSE)),VLOOKUP(D7,Sheet2!C2:D164,2,FALSE),VLOOKUP(D7,Sheet2!A2:B164,2,FALSE))  

Note


Solved by TrowaD

Related :

This document entitled « How to combine columns using Vlookup? » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.