Function Problems

Return the Correct Price in Excel with XLOOKUP or VLOOKUP

Tauseeq MagsiTauseeq Magsi Dec 2, 2026 869 views

Question details

Find the correct price for a part name without requiring the price list to be sorted.

Return the Correct Price in Excel with XLOOKUP or VLOOKUP
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet looks up part names in a price list whose names are not sorted in ascending order.
Observed behavior
LOOKUP can return an incorrect price because it relies on ascending order for reliable approximate matches.
Before you start

Confirm where the part name and price columns are located and whether your price list is an Excel table named Prices. If using the VLOOKUP formula below, Part Name must be the first column in the selected range and Price must be the second.

Solution 1Recommended

Use XLOOKUP to find an exact part name

Use this method when XLOOKUP is available and you want a custom message for missing parts.

1
Enter the lookup formula

Select the cell where you want the price and enter =XLOOKUP(A2,Prices[Part Name],Prices[Price],"Not found"). Replace A2 or the table and column names if your worksheet uses different references.

2
Fill the formula down

Press Enter, then drag the cell's fill handle down to look up prices for the remaining part names.

3
Check unexpected results

Compare the part name in A2 with the entries in Prices[Part Name]. Check for leading or trailing spaces, spelling differences, and duplicate names.

Use XLOOKUP to find an exact part name
Exact matches do not require sorting: XLOOKUP uses exact matching by default and returns the first match if a part name appears more than once.
Work with prices in WPS Spreadsheet

Look up exact part prices in WPS Spreadsheet

Use an exact-match VLOOKUP formula in WPS Spreadsheet to find prices without sorting the part names.

  1. 1. Open your workbook: Open WPS Spreadsheet and select File > Open to choose your workbook.
  2. 2. Identify the price range: Locate the part name and price columns. For example, use A2 as the part to find and columns D and E as the part and price list.
  3. 3. Enter the formula: Select the result cell and enter =VLOOKUP(A2,$D$2:$E$100,2,FALSE). Adjust the range to include your price list, with part names in its first column.
  4. 4. Fill and check: Press Enter, then drag the fill handle down. Check spelling and spaces if a part returns #N/A.
Find prices in an unsorted part list with exact-match VLOOKUPOpen and edit Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does LOOKUP return the wrong price?

LOOKUP expects its lookup values to be sorted in ascending order for reliable approximate matching. Use XLOOKUP or VLOOKUP with FALSE to match an unsorted part list exactly.

Do I need to sort the part names for exact-match VLOOKUP?

No. Set the fourth argument to FALSE, as in =VLOOKUP(A2,$D$2:$E$100,2,FALSE), to find an exact match without sorting.

What does #N/A mean in my VLOOKUP result?

It usually means the formula did not find an exact match. Check the lookup value and the first column of the selected range for spelling differences and extra spaces.

What happens if the price list contains duplicate part names?

XLOOKUP and exact-match VLOOKUP return the first matching entry by default. Review duplicate rows if the same part name has different prices.

Can VLOOKUP return a price from a column to the left of the part name?

No. VLOOKUP searches the first column of its selected range and returns a value to its right. Move the columns or use XLOOKUP with separate lookup and return ranges.