Manually matching product IDs to fluctuating price lists is a tedious, error-prone process that drains valuable administrative hours. When aligning procurement budgets with standard funding sources, operational accuracy is non-negotiable. Utilizing the correct Excel lookup formula grants you absolute precision and confidence in your financial reporting.
As a key stipulation, both datasets must share identical data formatting to prevent common lookup errors. For example, using the XLOOKUP function to match product ID "PROD-102" to its approved contract price serves as the standard approach to guarantee data integrity. Below, we explore the exact formulas and implementation steps required to streamline your workflow.
Managing inventory, sales, and financial reports in Excel almost always requires linking different data sets. One of the most common tasks is matching a Product ID from a sales or order sheet to a master Price List to retrieve the correct unit price.
Depending on your version of Excel and your specific data structure, there are several ways to accomplish this. This guide will walk you through the three most effective Excel formulas to match Product IDs with prices: XLOOKUP, INDEX & MATCH, and VLOOKUP. We will also cover how to handle common errors and apply advanced matching techniques like tiered pricing.
To make these examples easy to follow, let's assume you have two worksheets in your Excel workbook:
Product ID in Column A, and you want to pull the Price into Column B.Product ID in Column A and the corresponding Price in Column B.| Orders Sheet (Target) | Price List Sheet (Source) |
|---|---|
|
Col A: Product ID (e.g., PROD-001) Col B: Price (Formula goes here) |
Col A: Product ID (e.g., PROD-001) Col B: Product Name Col C: Base Price ($19.99) |
If you are using Microsoft 365, Excel 2021, or Excel for the Web, XLOOKUP is the absolute best formula to use. It is safer, easier to write, and more flexible than older lookup formulas.
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode])
To match the Product ID in cell A2 of your Orders sheet with the price in your Price List sheet, enter the following formula in cell B2:
=XLOOKUP(A2, 'Price List'!$A$2:$A$500, 'Price List'!$C$2:$C$500, "Price Not Found", 0)
A2: The Product ID you want to look up.'Price List'!$A$2:$A$500: The column in your master list containing the Product IDs. (Absolute references $ ensure the range doesn't shift when you drag the formula down).'Price List'!$C$2:$C$500: The column containing the prices you want to return."Price Not Found": (Optional) The text Excel will display if the Product ID does not exist in the master list.0: Instructs Excel to perform an exact match (this is actually the default behavior of XLOOKUP, but defining it is a good habit).Why XLOOKUP is superior: It doesn't care if the Price column is to the left or right of the Product ID column. It also prevents errors if you insert or delete columns in your master sheet later.
If you are using an older version of Excel (like Excel 2013, 2016, or 2019) and want a robust, high-performance formula that won't break when columns are added or removed, INDEX & MATCH is your best option.
This method combines two functions:
MATCH finds the row number where the Product ID is located.INDEX retrieves the price from that specific row number.=INDEX(return_column, MATCH(lookup_value, lookup_column, 0))
Enter this formula in cell B2 of your Orders sheet:
=INDEX('Price List'!$C$2:$C$500, MATCH(A2, 'Price List'!$A$2:$A$500, 0))
MATCH(A2, 'Price List'!$A$2:$A$500, 0): Excel searches Column A of the Price List for the ID in cell A2. The 0 specifies an exact match. If it finds the ID on row 15, MATCH returns the number 14 (since row 15 is the 14th item in the range $A$2:$A$500).INDEX('Price List'!$C$2:$C$500, 14): Excel goes to the price range (Column C) and extracts the value from the 14th cell down, which is your price.VLOOKUP is the most famous lookup formula in Excel. While legacy users still use it widely, it has one major limitation: the Product ID column must be the very first column in the lookup range. It cannot search to its left.
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
If your Price List has Product ID in Column A, Product Name in Column B, and Price in Column C, Column C is the 3rd column in that range. Enter this formula in cell B2:
=VLOOKUP(A2, 'Price List'!$A$2:$C$500, 3, FALSE)
A2: The Product ID you are matching.'Price List'!$A$2:$C$500: The entire database block containing both the lookup column and the data you want to retrieve.3: Tells Excel to pull the result from the 3rd column of the highlighted block (Column C).FALSE: Forces Excel to look for an exact match. Warning: If you omit this or type TRUE, Excel will return incorrect prices if your IDs are not sorted alphabetically!Even with the correct formula, you might run into errors. Here is how to fix the most common issues:
This means Excel cannot find the Product ID. Check the following:
TRIM function to clean your data: `=XLOOKUP(TRIM(A2), TRIM('Price List'!$A$2:$A$500), 'Price List'!$C$2:$C$500)`.10203), while the other stores it as text (formatted as text, or with an apostrophe like '10203). Ensure both columns are formatted identically.This occurs if you tell VLOOKUP to pull from a column index that is outside your range. For example, if your table array is $A$2:$B$500 (2 columns) but your column index is set to 3, Excel will throw a #REF! error because column 3 does not exist in your defined range.
Instead of referencing cell coordinates (like $A$2:$C$500), convert your Price List into an official Excel Table by highlighting it and pressing Ctrl + T. Name your table PriceTable.
Once converted, you can write highly readable formulas that automatically expand as you add new products:
=XLOOKUP(A2, PriceTable[Product ID], PriceTable[Price], "Not Found")
With structured references, you never have to worry about updating your formula when you add new products to your master price list.
Use this quick guide to choose the right formula for your workbook:
Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.