VLOOKUP in Excel with example

The VLOOKUP function is used to search for a value in the first column of a range and return a value in the same row from another column in the range.


Syntax:

=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
  • lookup_value: The value to search for.
  • table_array: The range of cells that contains the data.
  • col_index_num: The column number (in the range) from which to return the value.
  • range_lookup: Optional; TRUE for approximate match or FALSE for exact match.

Example: Employee Data Lookup

Sample Data:

IDNameDepartmentSalary
101John SmithIT60000
102Mary JohnsonHR55000
103Alex BrownFinance75000
104Chris LeeMarketing52000
105Sarah WilsonIT58000

Task:

Find the Department and Salary of an employee with ID 103.


Step 1: Use VLOOKUP for Department

  1. Formula: =VLOOKUP(103, A2:D6, 3, FALSE)
  2. Explanation:
    • 103: The value to look for in the first column.
    • A2:D6: The table array containing the data.
    • 3: The column number for the Department.
    • FALSE: An exact match is required.
  3. Result: Finance

Step 2: Use VLOOKUP for Salary

  1. Formula: =VLOOKUP(103, A2:D6, 4, FALSE)
  2. Explanation:
    • 103: The value to look for in the first column.
    • A2:D6: The table array containing the data.
    • 4: The column number for the Salary.
    • FALSE: An exact match is required.
  3. Result: 75000

Key Notes:

  1. The lookup_value (e.g., ID) must be in the first column of the table.
  2. The col_index_num specifies the column to return a value from (relative to the table range).
  3. Use FALSE for an exact match (recommended for most use cases).

Use Case Example:

IDLookup Department FormulaLookup Salary Formula
103=VLOOKUP(103, A2:D6, 3, FALSE)=VLOOKUP(103, A2:D6, 4, FALSE)