How to Match Part Numbers with Inventory Locations in Excel

📅 Aug 04, 2026 📝 Sarah Miller

Locating specific part numbers across vast inventory sheets remains a persistent, time-draining headache for warehouse managers. While organizations frequently rely on standard capital funding sources to acquire complex, high-cost ERP software, a smarter, immediate solution lies right in your spreadsheets. Leveraging advanced Excel formulas grants your team instant visibility into precise bin locations without the enterprise price tag. As a stipulation, success relies on strict data consistency and eliminating leading spaces. Popular functions like XLOOKUP and INDEX/MATCH serve as robust tools to automate this cross-referencing. Below, we outline the exact step-by-step formulas to streamline your inventory tracking today.

How to Match Part Numbers with Inventory Locations in Excel

Excel Formula to Match Part Number with Inventory Location

Managing a warehouse, retail store, or manufacturing plant requires tight control over inventory. One of the most common daily challenges is quickly identifying exactly where a specific item is stored. If you have a list of part numbers and a master inventory sheet, you do not need to hunt through thousands of rows manually. Excel offers several powerful formulas to automate this process.

In this comprehensive guide, we will explore the best Excel formulas to match a part number to its inventory location-ranging from the classic VLOOKUP to the highly flexible INDEX/MATCH combo, and finally, the modern and robust XLOOKUP. We will also cover how to handle common errors like trailing spaces, missing parts, and data format mismatches.

Setting Up the Scenario

Before diving into the formulas, let us establish a standard data scenario. Imagine you have two worksheets in your Excel workbook:

  • "Master_Inventory" Sheet: This contains your source data. Column A contains the Part Number, Column B contains the Description, and Column C contains the Bin Location.
  • "Pick_List" Sheet: This is your active workspace. You type or scan a Part Number into Column A, and you want Excel to automatically populate the Bin Location in Column B.
Part Number (Col A) Description (Col B) Bin Location (Col C)
PN-1001 1/2" Hex Bolt Aisle 4, Shelf B1
PN-1002 3/4" Steel Washer Aisle 2, Shelf C4
PN-1003 M10 Carbon Nut Aisle 1, Shelf A3

Method 1: The Classic VLOOKUP Formula

The VLOOKUP (Vertical Lookup) function is the most widely known method for retrieving matching data in Excel. It searches down the first column of a designated range and returns a value in the same row from a specified column to the right.

The Formula Syntax

=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

How to Apply It

To find the location of a part number listed in cell A2 of your "Pick_List" sheet using the master data on "Master_Inventory", enter the following formula in your location column:

=VLOOKUP(A2, Master_Inventory!A:C, 3, FALSE)

How It Works

  • A2: This is the part number you want to look up.
  • Master_Inventory!A:C: Excel searches columns A through C on the Master Inventory sheet.
  • 3: Because "Bin Location" is the third column in our range (A is 1, B is 2, C is 3), we specify 3.
  • FALSE: This tells Excel to look for an exact match. If the part number does not exist, it will return an error instead of guessing the closest match. Always use FALSE (or 0) for part numbers.

Limitations of VLOOKUP

While easy to use, VLOOKUP has a major drawback: the lookup column (Part Number) must be the left-most column in your target range. If your database has the Bin Location in Column A and the Part Number in Column B, VLOOKUP cannot look "backward" to the left without complex workarounds.


Method 2: INDEX and MATCH (The Flexible Alternative)

To overcome the limitations of VLOOKUP, experienced Excel users rely on the combination of INDEX and MATCH. This method is faster, highly flexible, and does not care where your columns are positioned.

The Formula Syntax

=INDEX(column_to_return, MATCH(lookup_value, column_to_search, 0))

How to Apply It

Using our scenario, enter this formula in your target cell:

=INDEX(Master_Inventory!C:C, MATCH(A2, Master_Inventory!A:A, 0))

How It Works

  • MATCH(A2, Master_Inventory!A:A, 0): The MATCH function searches column A of the master sheet for the value in cell A2. It returns the exact row number where that part is found (e.g., Row 4). The 0 ensures an exact match.
  • INDEX(Master_Inventory!C:C, ...): The INDEX function goes to the Bin Location column (Column C) and grabs the value at the row number calculated by the MATCH function.

Why It's Better

If you insert a new column into your master inventory sheet (such as "Supplier" between description and location), VLOOKUP will break because column index "3" now refers to the new column. INDEX/MATCH will not break because it references direct column ranges rather than index numbers.


Method 3: XLOOKUP (The Modern, Gold-Standard Solution)

If you are using Microsoft 365, Excel 2021, or Excel for the Web, you have access to XLOOKUP. This function replaces both VLOOKUP and INDEX/MATCH by offering a simpler syntax with built-in error handling.

The Formula Syntax

=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode])

How to Apply It

To find your part location with XLOOKUP, use this clean formula:

=XLOOKUP(A2, Master_Inventory!A:A, Master_Inventory!C:C, "Not in Stock")

How It Works

  • A2: The part number you are searching for.
  • Master_Inventory!A:A: The array containing all the part numbers.
  • Master_Inventory!C:C: The array containing the bin locations you want to return.
  • "Not in Stock": If the part number is not found in the search list, Excel will automatically output this text instead of throwing an ugly #N/A error. This eliminates the need for nesting inside an IFERROR function.

Handling Common Inventory Data Issues

Even the best formulas will fail if your spreadsheet data is dirty. Here is how to fix the three most common lookup issues in inventory sheets.

1. Eliminating Hidden Spaces with TRIM

A common headache occurs when part numbers are scanned or imported with trailing or leading spaces (e.g., "PN-1001 " instead of "PN-1001"). This causes formulas to report a #N/A error because the characters do not match exactly.

To fix this, wrap your lookup value in the TRIM function, which automatically strips out extra spaces:

=XLOOKUP(TRIM(A2), Master_Inventory!A:A, Master_Inventory!C:C, "Not Found")

2. Addressing Text vs. Number Formatting

If your part numbers consist only of digits (e.g., 100523), Excel may store some as numerical values and others as text format. A lookup formula will not match a numerical 100523 with a text-formatted "100523".

  • To convert a text lookup value to a number dynamically: =XLOOKUP(VALUE(A2), Master_Inventory!A:A, Master_Inventory!C:C)
  • To convert a numeric lookup value to text dynamically: =XLOOKUP(A2&"", Master_Inventory!A:A, Master_Inventory!C:C)

3. Wildcard Matches for Partial Part Numbers

If you only know the beginning or end of a part number, you can use wildcards (* represents any number of characters). For instance, to search for a part starting with "PN-100" in XLOOKUP, configure your formula like this:

=XLOOKUP(A2 & "*", Master_Inventory!A:A, Master_Inventory!C:C, "No Match", 2)

The 2 in the fifth argument tells XLOOKUP to allow wildcard character matching.


Summary of Best Practices

To keep your inventory lookups fast and reliable, follow these design principles:

  1. Use Excel Tables: Convert your master list into a native Excel Table (Ctrl + T). This creates dynamic named ranges that expand automatically as you add new part numbers and inventory locations.
  2. Keep Master Data Unique: Ensure your Part Number column does not contain duplicates. If duplicates exist, lookup functions will only return the location of the first matching entry.
  3. Use XLOOKUP when possible: It is faster to write, easier to read, and less prone to breaking when columns are rearranged.

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.