VLOOKUP
VLOOKUP searches for a value in the first column of a table and returns a value from another column.
Syntax
=VLOOKUP(lookup_value,table_array,col_index_num,[range_lookup])
Example
|
ID |
Name |
Department |
Salary |
|
E101 |
Amit |
Sales |
45000 |
|
E102 |
Neha |
HR |
50000 |
|
E103 |
Rahul |
IT |
65000 |
If E2 contains E102:
=VLOOKUP(E2,A2:D4,2,FALSE)
Result: Neha
To retrieve salary:
=VLOOKUP(E2,A2:D4,4,FALSE)
Result: 50000
Important
FALSE means exact match.
HLOOKUP
HLOOKUP searches for a value in the first row of a table and returns a value from another row.
Syntax
=HLOOKUP(lookup_value,table_array,row_index_num,[range_lookup])
Example:
|
Jan |
Feb |
Mar |
|
|
Sales |
50000 |
60000 |
75000 |
|
Profit |
10000 |
12000 |
15000 |
=HLOOKUP(“Mar”,B1:D3,2,FALSE)
Result: 75000