How to Look Up and Return Values in Excel: VLOOKUP, XLOOKUP, INDEX/MATCH, FILTER, and OFFSET

How to Look Up and Return Values in Excel: VLOOKUP, XLOOKUP, INDEX/MATCH, FILTER, and OFFSET

One of the most common tasks in Excel is looking up a reference value and returning the result in the desired cell. Common examples include retrieving a customer name from a customer code, filling in a price from a product name, or returning values that meet multiple criteria. However, with so many functions available, it can be difficult to know which method to use.

This article covers the main ways to look up and return values in Excel in one place, including the advantages, disadvantages, and recommended use cases for each method. Examples are included to help both beginners and users looking for cleaner solutions at work.

Quick Answer: Which Method Should You Use?

  • Best all-around, modern option: XLOOKUP
  • When older-version compatibility matters: VLOOKUP or INDEX/MATCH
  • Left-side lookups and flexible lookups: INDEX/MATCH
  • When you want to return multiple results at once: FILTER
  • When you need to dynamically change the reference position: OFFSET
  • For simple manual tasks: Find and Replace, paste, or Power Query

Sample Data

Product CodeProduct NameCategoryUnit PriceStock
P1001LaptopElectronics95000012
P1002MouseElectronics2500055
P1003KeyboardElectronics4900034
P1004MonitorElectronics2190008
P1005ChairFurniture8900020

For example, assume that product code P1003 is entered in cell A10 and you want to return the corresponding product name in cell B10.

1. How to Look Up and Return a Value with VLOOKUP

This is one of the best-known lookup functions. It searches for the entered value in the first column of a table and returns a value from a column to the right.

=VLOOKUP(A10,$A$2:$D$6,2,FALSE)

This formula finds the product code in A10 in the first column of the A2:D6 range and returns the product name from the second column.

Advantages

  • Widely used, with plenty of learning resources available
  • Easy for beginners to learn the basic structure
  • Good compatibility with older versions of Excel

Disadvantages

  • Can only look up values to the right
  • Requires a numeric column index, so inserting columns can easily break the formula
  • Not convenient for complex conditional lookups

Recommended Use Case

It is suitable when your organization still uses older versions of Excel and you only need a simple code-to-result lookup.

2. How to Look Up and Return a Value with XLOOKUP

XLOOKUP is a modern lookup function that addresses many of VLOOKUP’s limitations. Microsoft support documentation and practical comparison resources describe it as a function that can replace VLOOKUP, HLOOKUP, and INDEX/MATCH in many cases.

=XLOOKUP(A10,$A$2:$A$6,$B$2:$B$6)

Advantages

  • Can look up values in either direction, left or right
  • Uses separate lookup and return ranges, making the structure clear
  • Makes it easy to specify text to display when no match is found

Disadvantages

  • Not available in older versions of Excel
  • Sharing files can cause problems if work computers use older versions

Recommended Formula for Workbooks

=XLOOKUP(A10,$A$2:$A$6,$D$2:$D$6,"Not found")

This looks up the unit price for the product code and displays “Not found” if there is no match.

3. How to Look Up and Return a Value with INDEX/MATCH

INDEX returns a value at a specified position, while MATCH finds the position of a value. Combining the two functions enables highly flexible lookups. Microsoft support documentation also presents INDEX/MATCH as an alternative to VLOOKUP.

=INDEX($B$2:$B$6,MATCH(A10,$A$2:$A$6,0))

Advantages

  • Supports left-side lookups
  • More resilient to inserted or deleted columns
  • Well suited to expanding into multiple-criteria lookups

Disadvantages

  • The structure may feel difficult for beginners
  • Can become difficult to manage as formulas get longer

Recommended Use Case

Use this approach when XLOOKUP is unavailable but you need a method that is more stable and flexible than VLOOKUP.

4. How to Return Multiple Values at Once with FILTER

FILTER returns multiple rows that meet a condition at once. Unlike VLOOKUP or XLOOKUP, which return one value in one cell, it is especially powerful when you need to spill all matching results at once. It is also frequently mentioned alongside XLOOKUP and INDEX/MATCH in comparison articles.

=FILTER(A2:D6,C2:C6="Electronics")

This displays only the rows whose category is Electronics.

Advantages

  • Immediately displays multiple matching results
  • Useful for creating reports and dashboards
  • Can produce clean results without helper columns

Disadvantages

  • Not available in older versions that do not support dynamic arrays
  • Works differently from traditional lookups that return a single value

5. How to Return a Value by Shifting the Reference Position with OFFSET

OFFSET refers to a value a specified number of rows and columns away from a starting cell. It is not directly a lookup function, but when combined with MATCH, it can calculate a position dynamically and return a value.

=OFFSET(A2,MATCH(A10,A2:A6,0)-1,1)

This formula finds the product code and then returns the value one column to the right in the matching row.

Advantages

  • Useful for creating flexible reference ranges
  • Well suited to dynamic charts and dynamic range settings

Disadvantages

  • Can be difficult to read
  • As a volatile function, it can affect performance with large amounts of data
  • Less intuitive than XLOOKUP or INDEX/MATCH for lookup-only tasks

6. When Should You Use HLOOKUP?

HLOOKUP is used to find values in horizontally arranged tables. However, most working tables are structured vertically, so it is used less often. In many cases, XLOOKUP can replace it.

=HLOOKUP(B1,$A$1:$E$3,3,FALSE)

7. Find and Replace, Manual References, and Power Query

Find and Replace

It is fast for one-time edits but cannot be automated.

Direct Cell References

They are quick for simple sheets with fixed positions but are fragile when the data changes.

Power Query

This method merges two tables using a common reference value to add the desired values. It is highly effective for recurring tasks and large-scale data cleanup, but it has a learning curve for beginners.

Comparison Table: Advantages and Disadvantages by Method

MethodAdvantagesDisadvantagesRecommended Use Case
VLOOKUPSimple, familiar, compatible with older versionsRight-side lookups only; fragile column indexSimple lookups, older-version environments
XLOOKUPIntuitive, supports left-side lookups, convenient error handlingNot supported in older versionsModern Excel, most work tasks
INDEX/MATCHFlexible, stable, supports left-side lookupsMore difficult for beginnersOlder versions when flexibility is needed
FILTERReturns multiple results at onceUnavailable in versions without dynamic array supportOutputting lists by condition
OFFSETSupports dynamic referencesReadability and performance concernsSpecial dynamic references
Power QueryExcellent for merging large datasetsRequires initial learningRecurring cleanup tasks

Which Method Should You Choose at Work?

  • You use modern Excel: Start with XLOOKUP
  • You need to return multiple results as a list: FILTER
  • Older-version compatibility is important: INDEX/MATCH
  • The task is very simple and the people you share with are familiar with it: VLOOKUP
  • You have many recurring merge tasks: Power Query

Common Errors and How to Fix Them

IssueCauseSolution
#N/AThe lookup value does not exist or contains different spacesUse TRIM or CLEAN, or verify an exact match
#VALUE!Range sizes do not matchCheck the sizes of lookup_array and return_array
Returns the wrong valueApproximate match settingUse FALSE as VLOOKUP’s fourth argument and 0 in MATCH
Ranges shift when copying formulasRelative referencesUse $ to lock absolute references

Related Articles

Conclusion

There is more than one way to look up a value and return it in the desired cell in Excel. The most important thing is not knowing the most functions, but choosing the right method for the situation. For modern versions, XLOOKUP is the best all-around choice; use FILTER when you need multiple results, and INDEX/MATCH remains powerful when older-version compatibility and flexibility are important. Rather than relying on only one method, choose the most appropriate option based on your data structure and sharing environment.

FAQ

Which is better, VLOOKUP or XLOOKUP?

If you use modern Excel, XLOOKUP is more convenient in most cases.

How can I look up a value to the left?

Use XLOOKUP or INDEX/MATCH.

How can I return multiple rows that meet a condition at once?

FILTER is the best function for this.

Leave a Reply

Your email address will not be published. Required fields are marked *