How to Lookup Up Cost For Product Or Service in Excel

Learn multiple Excel methods to lookup up cost for product or service with step-by-step examples, real-world scenarios, and expert tips.

excelformulaspreadsheettutorial
12 min read • Last updated: 7/2/2025

How to Lookup Up Cost For Product Or Service in Excel

Why This Task Matters in Excel

In every organisation, knowing the exact cost of a product or service at the moment you need it is essential for fast quoting, budgeting, and profitability analysis. Sales teams rely on up-to-date price sheets to prepare proposals on the fly, purchasing departments use cost lookups to compare vendor offers, and project managers build cost models that expand or contract as project scope changes.

Excel’s flexible grid is often the central repository for those price lists. A single workbook may include thousands of SKUs, multiple vendor tiers, regional price variations, and periodic discounts. Without a rapid method to locate the correct cost, users spend valuable time scrolling or filtering, or—worse—use outdated values that erode margins or misinform customers.

Typical scenarios include:

  • A help-desk agent needs to quote the annual maintenance fee for a specific software module while on the phone with a client.
  • A construction estimator pulls unit costs for concrete, rebar, and labour to compile a bid in under 30 minutes.
  • A finance analyst reconciles actual purchase orders against an approved price list to highlight over-billing.

Excel’s lookup functions (XLOOKUP, VLOOKUP, INDEX + MATCH, FILTER, and their dynamic-array cousins) provide instant retrieval, eliminate manual errors, and integrate seamlessly with pivot tables, dashboards, and Power Query workflows. Mastering cost lookup is therefore not just a time-saver; it is foundational to accurate reporting, reliable forecasting, and decision-making across sales, supply-chain, and finance. Failing to master it leads to missed revenue, unnecessary spend, and erosion of trust in your data.

Best Excel Approach

For modern versions of Excel (Microsoft 365 and Excel 2021), XLOOKUP is usually the fastest, safest, and most flexible way to retrieve a cost based on a product or service identifier. It supports approximate or exact matches, can search from bottom to top, and allows custom messages when no match is found—all in one compact formula.

=XLOOKUP( lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode] )
  • lookup_value – the product name, SKU, or service code you want to price.
  • lookup_array – the column or row that contains those identifiers.
  • return_array – the column or row that contains the associated cost.
  • [if_not_found] – optional text or value if the product is missing.
  • [match_mode] – 0 for exact match (default), 1 for next larger, −1 for next smaller, 2 for wildcard.
  • [search_mode] – 1 search top-to-bottom (default), −1 bottom-to-top, 2 binary search.

When should you choose XLOOKUP over alternatives?

  • Your workbook is already using dynamic arrays or you are on Microsoft 365.
  • You anticipate inserting new columns between identifier and cost columns (XLOOKUP is position-independent).
  • You need a single formula that handles missing items gracefully.

If you are on Excel 2019 or earlier, INDEX + MATCH remains a robust, flexible alternative:

=INDEX( Cost_Column, MATCH( lookup_value, ID_Column, 0 ) )

Parameters and Inputs

Before you write any formula, confirm the following inputs:

  1. Lookup Value
  • Data type: text, number, or mixed (e.g. “A-102”, 14567).
  • Must exactly match the entry in the source list when using exact-match mode.
  • Leading/trailing spaces or inconsistent case can cause failures—trim or clean the data first.
  1. Lookup Array
  • A contiguous single-column range such as [A2:A8000] or a structured Table column like TablePrices[SKU].
  • No duplicates for the same product unless you specifically want the first or last cost.
  1. Return Array
  • The column holding the price or cost figure (currency, percentage, or unit cost).
  • Should be aligned row-for-row with the lookup array.

Optional settings:

  • if_not_found – supply \"Product not listed\" or 0 to avoid #N/A errors in downstream calculations.
  • match_mode – use 2 (wildcard) if you store truncated names like “Consult*”.
    Input validation:
  • Use Data Validation drop-downs for lookup values to prevent typos.
  • Convert source ranges to Excel Tables so formulas expand automatically when you add new products.

Step-by-Step Examples

Example 1: Basic Scenario

Imagine a simple price sheet in [A1:B8]:

AB
ProductUnit Cost
Keyboard28.50
Monitor149.00
Mouse12.75
Docking Station79.90
Webcam55.00
Headset31.20

You build an order sheet where cell [E2] captures the item name customers request. In [F2] you want the cost.
Step 1 – Activate cell [F2].
Step 2 – Enter:

=XLOOKUP( E2, A2:A8, B2:B8, "Item not found" )

Step 3 – Press Enter. The formula displays the cost for the item typed in [E2].

Why it works: XLOOKUP scans [A2:A8] for the exact text in [E2]. Once located, it returns the parallel entry from [B2:B8]. Because the ranges are vertical, no column index is required, and inserting a new column has no impact.

Common variations

  • If you have multiple order lines, wrap the formula in an IF statement that checks whether the product cell is blank.
  • When you quote retail and wholesale prices, change return_array to TablePrices[Wholesale] or TablePrices[Retail] depending on user selection.

Troubleshooting tips

  • Blank result? Confirm that [E2] is spelled exactly as in the list—use Data Validation to restrict choices.
  • #N/A error? Provide an [if_not_found] argument or enable partial-match mode with wildcards.

Example 2: Real-World Application

A logistics company stores a master rate card with more than 5 000 shipping services from multiple carriers. TableRates includes columns Carrier, Service_Code, Zone, Weight_Bracket, and Cost. To produce a quote, an estimator selects:

  • Carrier in [H2]
  • Service_Code in [I2]
  • Zone in [J2]
  • Weight in [K2]

Because multiple criteria are involved, a single XLOOKUP will not suffice. Instead, combine FILTER to reduce the list, then XLOOKUP to pinpoint the correct bracket:

=LET(
   subset, FILTER(TableRates, (TableRates[Carrier]=H2) * (TableRates[Service_Code]=I2) * (TableRates[Zone]=J2) ),
   XLOOKUP( K2, subset[Weight_Bracket], subset[Cost], "No rate" )
)

Walkthrough:

  1. FILTER extracts only rows that match carrier, service, and zone, producing a dynamic array named subset.
  2. XLOOKUP then searches the Weight_Bracket column inside subset for the requested weight and returns the corresponding cost.

Business value: The estimator sees an immediate cost after selecting criteria—no manual filtering needed. Because the formula is dynamic, adding new weight brackets or carriers updates every quote template instantly.

Performance considerations:

  • Using LET reduces calculation overhead by reusing the FILTER result rather than recalculating it repeatedly.
  • Turn the rate card into a Table; Tables auto-expand without changing formulas.

Example 3: Advanced Technique

You manage a SaaS subscription catalog where each product has tiered pricing depending on user count and contract length. The data is stored on a sheet named Tiers:

SKUUsers_FromUsers_ToTerm (Months)Unit_Cost
CRM-PRO1251229
CRM-PRO26501227
CRM-PRO511001225
CRM-PRO1252427
CRM-PRO26502425
CRM-PRO511002423

In a quotation sheet, the seller enters SKU in [B3], users in [C3], and term in [D3]. You need the correct Unit_Cost accounting for two numeric ranges (Users_From/To and Term) plus SKU.

The formula:

=LET(
  sk, B3,
  us, C3,
  tm, D3,
  tbl, Tiers,
  filtered, FILTER( tbl, (tbl[SKU]=sk) * (us >= tbl[Users_From]) * (us <= tbl[Users_To]) * (tbl[Term (Months)]=tm) ),
  INDEX( filtered[Unit_Cost], 1 )
)

Explanation:

  • FILTER narrows the table to rows that match SKU, the user count range, and the exact term.
  • Because only one row should meet all criteria, INDEX returns the first (and only) Unit_Cost.
  • Using >= and <= operators inside the FILTER criteria handles the numeric banding elegantly.

Edge cases handled:

  • If no tier fits, FILTER returns empty, causing a #CALC! error. Wrap INDEX in IFERROR to display “Tier missing”.
  • If data entry staff mistakenly creates overlapping user ranges, FILTER may return multiple rows, so validate the table periodically.

Performance tips:

  • Place the Tiers table on a separate sheet and convert it to an official Excel Table so structural references stay readable.
  • Use the dynamic spill result to audit which row matched—temporarily change INDEX to return the entire filtered array to verify logic.

Tips and Best Practices

  1. Convert every price list to an Excel Table (Ctrl + T). Table references stay intact when rows grow, and structured names make formulas self-documenting.
  2. Use named ranges or LET variables to clarify multi-line formulas. This halves maintenance time when the logic changes.
  3. Keep identifiers in the first column of your Table so legacy VLOOKUP sheets still work.
  4. Add an [if_not_found] argument (XLOOKUP) or wrap older formulas in IFERROR to avoid ugly #N/A cells that break totals.
  5. For long lists, enable the Range Lookups sheet option “Exact match” to prevent slow approximate searches, or pre-sort lists if you require binary searches for speed.
  6. Combine Data Validation drop-downs with lookup formulas for bullet-proof order forms—users can only choose valid products, and costs appear instantly.

Common Mistakes to Avoid

  1. Using approximate match unintentionally. Setting match_mode to 1 or leaving VLOOKUP’s fourth argument FALSE will return wrong prices when lists are unsorted. Always stick to exact match unless you truly need range pricing.
  2. Hard-coding column numbers in VLOOKUP. When you insert a new column, every formula shifts and begins to pull the wrong cost. Switch to XLOOKUP or INDEX + MATCH, which are column-order independent.
  3. Forgetting to lock ranges with absolute references. Copying a formula down without anchoring [A2:B1000] can shift the lookup array and produce #REF! errors.
  4. Letting dirty data creep in. Extra spaces, inconsistent dashes, or Upper/Lower case mismatches break lookups. Regularly TRIM/CLEAN your source, or use Power Query to standardise.
  5. Relying on duplicate identifiers. If the same SKU appears twice with different costs, XLOOKUP returns the first match by default, possibly the wrong tier. Enforce uniqueness or decide clearly whether you need first, last, or all matches.

Alternative Methods

Sometimes you cannot use XLOOKUP or dynamic arrays—maybe you share files with clients on Excel 2010, or you must calculate inside Power Pivot. Here is a comparison of popular techniques:

MethodExcel VersionProsCons
VLOOKUP2007-365Easy syntax, widely knownBreaks when columns move, defaults to approximate match unless FALSE, only searches left-to-right
INDEX + MATCH2007-365Column-independent, two-way lookups, works vertically or horizontallySlightly longer formula, no built-in not-found message
XLOOKUP365 / 2021All-in-one, handles left/right lookups, custom default, accepts arraysNot available in older versions
FILTER + INDEX/XLOOKUP365Multi-criteria, dynamic spill for auditingRequires dynamic array engine
Power Query Merge2010-365Handles millions of rows, no formulas, refreshableData is static until refresh, learning curve
VBA DictionaryAll desktopUltra-fast, can run loopsRequires macros, not suitable for shared cloud workbooks

Choose INDEX + MATCH if:

  • You need compatibility down to Excel 2007.
    Choose Power Query if:
  • Your price list is external (CSV, database) and exceeds 1 000 000 rows.
    Choose VLOOKUP only when:
  • You hand off the file to users who only understand VLOOKUP and the sheet structure will never change.

FAQ

When should I use this approach?

Use cost lookups every time pricing drives a calculation—quotes, budgets, variance analyses, or dashboards—especially when the source list changes frequently and accuracy is paramount.

Can this work across multiple sheets?

Yes. Point lookup_array and return_array to another worksheet, or even another workbook that is open. For closed workbooks, ensure the full path is referenced and keep folder structures stable.

What are the limitations?

All lookup functions return the first match by default. If you need to aggregate multiple costs (for example, list all valid prices for a SKU), use FILTER or SUMIFS. Also, XLOOKUP is not available in Excel 2016 or earlier.

How do I handle errors?

Wrap formulas in IFERROR or use XLOOKUP’s [if_not_found] to display friendly text. Audit the source list regularly—most errors originate from missing or misspelled identifiers.

Does this work in older Excel versions?

VLOOKUP and INDEX + MATCH cover Excel 2007 onward. XLOOKUP, FILTER, and LET require Microsoft 365 or Excel 2021. If collaboration spans versions, keep a compatibility-only sheet that uses INDEX + MATCH.

What about performance with large datasets?

  • Sort lookup arrays and use binary search (match_mode 1 or −1) for thousands of rows.
  • Avoid volatile functions like INDIRECT.
  • Convert lists to Tables and reference entire columns; Excel handles them efficiently.
  • In Power Query, perform merges rather than cell-by-cell formulas when rows exceed 100 000.

Conclusion

Learning to look up the correct cost for any product or service transforms Excel from a simple calculator into a dynamic pricing engine. Whether you adopt modern XLOOKUP or maintain INDEX + MATCH for legacy workbooks, the principles remain: clean identifiers, well-structured Tables, and precise match logic. Master these fundamentals, and you’ll deliver error-free quotes, tight cost controls, and insightful financial models in a fraction of the time. Keep experimenting with FILTER, LET, and Power Query to push your skills further, and soon price retrieval will be the most reliable part of your workflow.

We use tracking cookies to understand how you use the product and help us improve it. Please accept cookies to help us improve.