First read article on simple vlookup in Excel
Many times there is need to compare two columns from the lookup table. Consider a table which contains employee data of different companies. Employee number would be unique to company, so we need to match company as well as empoyee number to get the designation.
Here you need to concatenate the key columns in the lookup table and form another column. Also for lookup value we have to concatenate company and emp no.
Formula for concatenate =CONCATENATE(A2,B2)
Now we need to lookup value for key column in the table.
Vlookup will look like this.
Note: Table_array mentioned here starts from the column key and not from the column company and emp no. This is because vlookup always looks up for the value in the first column of the table array.
Final output excel will look like this.
Many times there is need to compare two columns from the lookup table. Consider a table which contains employee data of different companies. Employee number would be unique to company, so we need to match company as well as empoyee number to get the designation.
Here you need to concatenate the key columns in the lookup table and form another column. Also for lookup value we have to concatenate company and emp no.
Formula for concatenate =CONCATENATE(A2,B2)
Now we need to lookup value for key column in the table.
Vlookup will look like this.
=VLOOKUP(C2,'Emp Details'!$C$1:$F$9,4,0)
Note: Table_array mentioned here starts from the column key and not from the column company and emp no. This is because vlookup always looks up for the value in the first column of the table array.
Final output excel will look like this.