๐ Excel Basics #19 โ VLOOKUP() Function
The VLOOKUP() function is one of Excel's most popular lookup functions. It searches for a value in the first column of a table and returns a value from another column in the same row.
ยซNote: Although XLOOKUP() is the modern replacement for VLOOKUP(), many companies still use VLOOKUP(), making it an important function to learn.ยป
๐ What is the VLOOKUP() Function?
VLOOKUP stands for Vertical Lookup.
It searches vertically in the first column of a table and returns a value from a specified column.
Syntax:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
๐ Arguments Explained
โข lookup_value โ The value you want to search for.
โข table_array โ The table containing the data.
โข col_index_num โ The column number from which to return the result.
โข range_lookup
โ FALSE โ Exact match (recommended)
โ TRUE โ Approximate match
๐ Example
ID | Name | Department
101 | Rahul | IT
102 | Priya | HR
103 | Amit | Finance
104 | Neha | Marketing
To find the department of Employee ID 103:
Formula:
=VLOOKUP(103,A2:C5,3,FALSE)
Result:
Finance
๐ Using a Cell Reference
If cell E2 contains the Employee ID:
=VLOOKUP(E2,A2:C5,3,FALSE)
Changing the value in E2 automatically returns the corresponding department.
๐ Common Errors
โ Searching in a column other than the first column.
โ Using the wrong column index number.
โ Forgetting to use FALSE for an exact match.
โ Returning #N/A when the value doesn't exist.
To avoid displaying errors:
=IFERROR(VLOOKUP(E2,A2:C5,3,FALSE),"Not Found")
๐ Limitations of VLOOKUP()
โข Can only search from left to right.
โข Breaks if columns are inserted or deleted because the column index changes.
โข Slower than newer lookup functions on very large datasets.
๐ Real-World Uses
โข Find employee details using Employee ID.
โข Retrieve product prices from a product list.
โข Get student marks using Roll Number.
โข Look up customer information.
โข Match invoice details with customer records.
โ
Best Practices
โข Always use FALSE for exact matches.
โข Keep the lookup column as the first column in the table.
โข Combine VLOOKUP() with IFERROR() for cleaner reports.
โข For new Excel versions, prefer XLOOKUP() as it is more flexible and powerful.
VLOOKUP() is one of the most frequently asked Excel interview topics and remains widely used in businesses worldwide.
Double Tap โค๏ธ For More
Post #2237
3.29K
- โค 10
- ๐ 2