2.7: Lookup Functions (VLOOKUP, HLOOKUP, INDEX/MATCH, XLOOKUP)
- Page ID
- 151140
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\dsum}{\displaystyle\sum\limits} \)
\( \newcommand{\dint}{\displaystyle\int\limits} \)
\( \newcommand{\dlim}{\displaystyle\lim\limits} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\(\newcommand{\longvect}{\overrightarrow}\)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Lookup functions are among Excel’s most powerful tools for connecting information across large datasets. Instead of manually searching through hundreds of rows or columns, lookup formulas locate and return related data automatically—saving time, reducing errors, and increasing efficiency in business, academic, and administrative workbooks.
VLOOKUP and HLOOKUP
The classic lookup functions—VLOOKUP (vertical lookup) and HLOOKUP (horizontal lookup)—search for a value in one column or row and return a related value from another.
Syntax:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
=HLOOKUP(lookup_value, table_array, row_index_num, [range_lookup])
Example:
=VLOOKUP(A2, Products!A:D, 3, FALSE) searches for the product ID in cell A2 within the table on the “Products” sheet and returns the value from the 3rd column of that table. The last argument, FALSE, ensures an exact match.
VLOOKUP and HLOOKUP are especially useful for reference tables—like matching student IDs with names, pulling pricing data, or retrieving grades from a master list. However, they do have limitations: VLOOKUP only searches to the right of the lookup column, and both functions can break if columns or rows are rearranged.
INDEX and MATCH (Advanced Lookup Combination)
To overcome these limitations, Excel professionals often use INDEX and MATCH together.
- MATCH locates the position of a value within a range.
- INDEX retrieves the value from a specific row and column.
Syntax:
=MATCH(lookup_value, lookup_array, [match_type])
=INDEX(array, row_num, [column_num])
Example:
=INDEX(C2:C100, MATCH("Smith", A2:A100, 0))
This combination searches column A for “Smith,” determines its row number, and returns the corresponding department name from column C.
Advantages of INDEX/MATCH:
- Works in any direction (left, right, up, or down).
- Less likely to break if data columns are inserted or rearranged.
- Can handle large datasets more efficiently than VLOOKUP.
Practical Example:
A college registrar could use INDEX/MATCH to find a student’s declared major by ID, while a sales analyst might use it to pull unit price data from a product catalog that changes structure periodically.
XLOOKUP (Modern Replacement)
Available in Excel 365 and Excel 2019+, XLOOKUP modernizes and simplifies the lookup process by combining the best features of VLOOKUP, HLOOKUP, and INDEX/MATCH.
Syntax:
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
Example:
=XLOOKUP("Product B", A2:A20, C2:C20, "Not Found") searches for “Product B” in column A and returns its price from column C. If “Product B” doesn’t exist, Excel displays “Not Found.”
Key Benefits of XLOOKUP:
- Searches in any direction—up, down, left, or right.
- Supports exact or approximate matches.
- Returns multiple columns or values simultaneously.
- Includes built-in error handling and dynamic arrays.
Use Cases:
- A human resources manager using XLOOKUP to retrieve employee details across multiple worksheets.
- A small business tracking part numbers and costs dynamically as inventory updates.
- A data analyst replacing complex nested IF or VLOOKUP statements with cleaner, more readable XLOOKUP formulas.
As Excel continues to evolve, XLOOKUP is quickly becoming the new standard for relational data retrieval, offering flexibility and stability across all modern Excel environments.
This page was created by pulling information from Computer Fundamentals for Technical Students (Heisserer) by Nick Heisserer, CC BY 4.0; Workplace Software and Skills (OpenStax) by OpenStax, CC BY 4.0; and Beginning Excel (Brown et al.) by Brown et al., CC BY-NC-SA 4.0.


