Function Problems

Calculate Recipe Costs from an Ingredient Price List in Excel

Elise WilliamsElise Williams Dec 2, 2026 868 views

Question details

Calculate the cost of each recipe ingredient using its quantity and a separate ingredient price list, then total the recipe cost.

Calculate Recipe Costs from an Ingredient Price List in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A workbook has ingredient names and unit costs on one sheet and recipe ingredients and quantities on another.
Observed behavior
Each recipe row should show its ingredient cost, and the row costs should add up to the total recipe cost.
Before you start

Place ingredient names in Ingredients!A2:A100 and their unit costs in Ingredients!B2:B100. On the recipe sheet, put ingredient names in column A and quantities in column C; make sure quantities use the same units as the listed prices.

Solution 1Recommended

Calculate Recipe Item Costs with XLOOKUP in Excel

Use XLOOKUP to find each ingredient's unit cost and multiply it by the recipe quantity.

This method requires an Excel version that supports XLOOKUP, such as Microsoft 365 or Excel 2021 and later. Ingredient names must match the names in the price list.

1
Enter the item cost formula

On the recipe sheet, select D2 and enter =IFERROR(C2*XLOOKUP(A2,Ingredients!$A$2:$A$100,Ingredients!$B$2:$B$100),"Not found"). Adjust the ranges if your price list is larger.

2
Fill the formula down

Select D2 and drag its fill handle down column D for every recipe ingredient.

3
Check unmatched items

Review any cells in column D that show "Not found". Check the ingredient name, price, and quantity, then correct the source data or recipe row.

4
Total the recipe cost

In a cell below the item costs, enter a SUM formula such as =SUM(D2:D10), changing D10 to the last recipe row.

Calculate Recipe Item Costs with XLOOKUP in Excel
Check all items before using the total: SUM ignores text, so a row showing "Not found" will not contribute to the total. Resolve those rows before relying on the result.
Calculate recipe costs in WPS Spreadsheets

Calculate Recipe Costs in WPS Spreadsheets

Open your workbook in WPS Spreadsheets and use VLOOKUP to match recipe ingredients to unit prices, calculate each item cost, and sum the recipe total.

  1. 1. Open the workbook: Open WPS Spreadsheets, select Open, and choose the workbook containing your recipe and ingredient price list.
  2. 2. Check the source columns: On the Ingredients sheet, put ingredient names in A2:A100 and unit prices in B2:B100. On the recipe sheet, put names in column A and quantities in column C.
  3. 3. Calculate item costs: Select D2 on the recipe sheet and enter =IFERROR(C2*VLOOKUP(A2,Ingredients!$A$2:$B$100,2,FALSE),"Not found"). Drag the fill handle down for the remaining ingredients.
  4. 4. Check and total the costs: Correct any rows showing "Not found", then enter =SUM(D2:D10) below the costs, adjusting the range to include all recipe rows.
  5. 5. Save the workbook: Select Save or Save As and choose an Excel-compatible XLSX format if you need to share the workbook with Excel users.
Match ingredient names to prices with VLOOKUPCalculate item costs and recipe totals in one workbookOpen and edit Microsoft Excel XLSX and XLS filesUse a familiar spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does an ingredient show "Not found"?

The ingredient name may not match the price list, or the formula may contain another error. Check the name in the recipe row, the matching name and price on the Ingredients sheet, and the quantity in column C.

How do I calculate a total for the whole recipe?

After calculating costs in column D, enter a formula such as =SUM(D2:D10) below the item costs. Adjust the range to cover all recipe rows and resolve any "Not found" entries first.

What if my Excel version does not support XLOOKUP?

Use =IFERROR(C2*VLOOKUP(A2,Ingredients!$A$2:$B$100,2,FALSE),"Not found") in D2, then fill it down. The ingredient names must be in the first column of the lookup range.

Can I use prices per kilogram with quantities in grams?

Convert the quantities to kilograms before multiplying, or convert the prices to a per-gram rate. The quantity and unit price must use the same unit for the calculated cost to be correct.