Sitemap
Nisrina Shofi

Nisrina Shofi

Sharing is caring ✨

Excel Lookup Function

4 min readOct 4, 2026

--

I want to share you about Excel Lookup Function: VLOOKUP, HLOOKUP, & XLOOKUP

Ilustration of Data Searching

VLOOKUP

VLOOKUP is used to look up data for a VERTICAL data source

For example:
You have a report (Data A) and a source data (Data B). You want to use VLOOKUP to retrieve Total Sales (pcs) from Data B and display it in Data A.

Press enter or click to view image in full size
Report (Data A) & Source (Data B)
=VLOOKUP(lookup_value;table_array;col_index_num;[range_lookup])
  1. lookup_value: The key value used to find the corresponding data. It should be available in both the report and the source data.
  2. table_array: The source data range, starting from the lookup key column and extending to the column containing the data you want to retrieve.
  3. col_index_num: The column number in the table_array that contains the data you want to retrieve.
  4. range_lookup: Use FALSE or 0 (null) for exact match
Press enter or click to view image in full size
VLOOKUP Function in Excel

In this case:

  1. Lookup_value: ID Employee (both available in Report (A) & Source (B)
  2. Table_array: Range from cell K4 to M11 (The $ symbol for locks the cell or range reference so that it does not change when the formula is copied.)
  3. col_index_num: 3 (In Source (B) ID Employee [col 1], Name Employee [col 2], Total Sales [col 3])
  4. 0 for exact match
Press enter or click to view image in full size
VLOOKUP Result

To copy the VLOOKUP formula, you can either double-click the fill handle in the bottom-right corner of the cell or drag the fill handle down to the last row.

Press enter or click to view image in full size
VLOOKUP for Total Sales

HLOOKUP

HLOOKUP is used to look up data for a HORIZONTAL data source

Get Nisrina Shofi’s stories in your inbox

Join Medium for free to get updates from this writer.

For example:
You have a report (Data A) and a source data (Data B). You want to use HLOOKUP to retrieve Target Sales (pcs) from Data B and display it in Data A.

Press enter or click to view image in full size
Report (Data A) & Source (Data B)
=HLOOKUP(lookup_value;table_array;row_index_num;[range_lookup])
  1. lookup_value: The key value used to find the corresponding data. It should be available in both the report and the source data.
  2. table_array: The source data range, starting from the lookup key column and extending to the column containing the data you want to retrieve.
  3. row_index_num: The row number in the table_array that contains the data you want to retrieve.
  4. range_lookup: Use FALSE or 0 (null) for exact match
Press enter or click to view image in full size
HLOOKUP Function in Excel

In this case:

  1. Lookup_value: Sales Area (both available in Report (A) & Source (B)
  2. Table_array: Range from cell I3 to Q4 (The $ symbol for locks the cell or range reference so that it does not change when the formula is copied.)
  3. row_index_num: 2 (In Source (B) ID Sales Area [row 1], Target Sales [Row 2])
  4. 0 for exact match
Press enter or click to view image in full size
HLOOKUP Result

To copy the VLOOKUP formula, you can either double-click the fill handle in the bottom-right corner of the cell or drag the fill handle down to the last row.

Press enter or click to view image in full size
HLOOKUP for Target Sales

XLOOKUP

XLOOKUP is used to look up data for a vertical data source.

=XLOOKUP(lookup_value;lookup_array;return_array;[if_not_found];[match_mode];[search_mode])

lookup_value= The key value used to find the corresponding data. It should be available in both the report and the source data.

lookup_array= The range in source data that contains the lookup_value

return_array= The range in source data that contains value you want to return in the report

if_not_find= OPTIONAL, what to display if the value isn’t found

match_mode= OPTIONAL, determines how Excel matches the value

search_mode= OPTIONAL, determines the search direction

Press enter or click to view image in full size
XLOOKUP in Excel (Report A & Source B)

lookup_value= Sales Area (both available in Report (A) & Source (B)

lookup_array= Range Sales Area in Source Data B from contains cell J4 to J8 (The $ symbol for locks the cell or range reference so that it does not change when the formula is copied.)

return_array= Range Transport Allowance in Source Data B contains cell K4 to K8 (The $ symbol for locks the cell or range reference so that it does not change when the formula is copied.)

if_not_find= the value to return if the lookup value is not find. In this case, enter 0

match_mode= enter 0 for exact match

search_mode= determines the search direction, you can leave it blank

Press enter or click to view image in full size
XLOOKUP Result

To copy the XLOOKUP formula, you can either double-click the fill handle in the bottom-right corner of the cell or drag the fill handle down to the last row.

Press enter or click to view image in full size
XLOOKUP for Transport Allowance

Thank you for reading ❤

--

--