Vlookup in ms excel
VLOOKUP is a function in Microsoft Excel that stands for "Vertical Lookup". It is used to search for a specific value in a column of data (known as the "lookup value") and return a corresponding value from a second column of data (known as the "result value").
The syntax for the VLOOKUP function is as follows:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
Where:
- lookup_value: The value you want to look up in the first column of the table.
- table_array: The range of cells that contains the table of data you want to search. The lookup value must be in the leftmost column of the table.
- col_index_num: The column number (starting from 1) in the table from which you want to retrieve a value.
- range_lookup: Optional. A logical value that specifies whether you want an exact match or an approximate match.
VLOOKUP is commonly used in data analysis to retrieve data from a large table or database, particularly when you need to find specific information quickly and efficiently.
In this example,
we'll assume the list of names starts in cell D2, and you want to retrieve
the grades in column E:
In cell E2, you can use the VLOOKUP function to find Bob's grade:
=VLOOKUP(D2, A1:B5, 2, FALSE)
Explanation of the VLOOKUP parameters:
D | E |
---|---|
Bob | |
David | |
Emily |
In cell E2, you can use the VLOOKUP function to find Bob's grade:
=VLOOKUP(D2, A1:B5, 2, FALSE)
Explanation of the VLOOKUP parameters:
- D2: The value you want to look up (in this case, the name "Bob").
- A1:B5: The range of cells containing the table where you want to search for the value. The first column of this range (column A) should contain the names, and the second column (column B) should contain the grades.
- 2: The column number from which you want to return the value. In this case, we want to return the grade, which is in the second column of the range (column B).
- FALSE: This is an optional parameter indicating that you want an exact match. If set to TRUE or omitted, VLOOKUP will try to find an approximate match, which requires the data to be sorted. Using FALSE ensures we get an exact match.
After copying down, your table should look like this:
D | E |
---|---|
Bob | 92 |
David | 95 |
Emily | 88 |