Build a Recipe Cost Calculator in Excel
By ExcelReady TeamUpdated 7 min read
The short answer
A recipe cost calculator in Excel needs two tables: an ingredient list with each pack's price and size, and the recipe with quantities. Work out the cost per unit (=B2/C2), pull it into the recipe with VLOOKUP, total the batch with SUMPRODUCT, then divide by the servings in G2 and round: =ROUND(SUMPRODUCT(B2:B6,C2:C6)/G2,2).
Key takeaways
- Price every ingredient per gram, millilitre or item: pack price divided by pack size.
- VLOOKUP with FALSE pulls each ingredient's unit cost into the recipe, so you update prices in one place.
- SUMPRODUCT multiplies quantities by unit costs and adds them up in one formula.
- Round the cost per serving with ROUND(...,2), and lock the servings cell with $ when you fill formulas.
- Food cost % is cost per serving divided by selling price; selling price is cost divided by your target %.
On this page+
- How the calculator is laid out
- Step 1: Work out the cost per unit for each ingredient
- Step 2: Pull each unit cost into the recipe with VLOOKUP
- Step 3: Total the batch cost with SUMPRODUCT
- Step 4: Calculate the cost per serving with ROUND
- Step 5: Find the food cost percentage and a menu price
- Allow for waste and trim
- Common recipe costing mistakes
- Practise it
A recipe cost calculator in Excel tells you what one batch costs, what each serving costs and what to charge for it. You keep one list of ingredient prices, and every recipe looks its costs up from that list, so when butter gets more expensive you change one cell and every recipe updates. This guide builds one step by step, using a batch of 12 muffins. It's for cooks, café and bakery owners, catering students and anyone applying for a hospitality job that uses Excel.
How the calculator is laid out#
The calculator uses two sheets:
- Ingredients: one row per ingredient, with what you pay for a pack and how much is in it.
- Recipe: one row per ingredient in the recipe, with the quantity it uses.
Keeping prices on their own sheet is the key idea. A recipe never contains a typed price; it always looks the price up. That way, one price change flows into every recipe.
Step 1: Work out the cost per unit for each ingredient#
Recipes use grams, millilitres and single items, but you buy packs. So first turn each pack price into a cost per unit. On a sheet called Ingredients:
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Ingredient | Pack price | Pack size | Unit | Cost per unit |
| 2 | Flour | 1.80 | 1000 | g | =B2/C2 |
| 3 | Butter | 3.00 | 250 | g | 0.012 |
| 4 | Eggs | 4.20 | 12 | each | 0.35 |
| 5 | Sugar | 2.50 | 1000 | g | 0.0025 |
| 6 | Milk | 1.20 | 1000 | ml | 0.0012 |
Type =B2/C2 in E2 and fill it down to E6 (Windows: Ctrl+D; Mac: ⌘D). Flour costs 1.80 for 1,000 g, so each gram costs 0.0018. Don't round these numbers: tiny unit costs need every decimal, or the totals drift.
Always enter pack size in the same unit the recipe uses. If you buy flour by the kilogram but the recipe uses grams, enter 1000, not 1.
Step 2: Pull each unit cost into the recipe with VLOOKUP#
On a sheet called Recipe, list the ingredients and quantities. Then let VLOOKUP fetch each unit cost from the Ingredients sheet:
=VLOOKUP(A2,Ingredients!$A$2:$E$6,5,FALSE)| A | B | C | D | |
|---|---|---|---|---|
| 1 | Ingredient | Qty | Cost per unit | Line cost |
| 2 | Flour | 500 | 0.0018 | 0.90 |
| 3 | Butter | 250 | 0.012 | 3.00 |
| 4 | Eggs | 3 | 0.35 | 1.05 |
| 5 | Sugar | 200 | 0.0025 | 0.50 |
| 6 | Milk | 250 | 0.0012 | 0.30 |
Here's what each part of the VLOOKUP does:
A2is the ingredient to find.Ingredients!$A$2:$E$6is the price table. The $ signs lock it, so it stays the same as you fill down.5returns the fifth column of the table, Cost per unit.FALSEmeans exact match only. Without it, VLOOKUP can return the wrong ingredient's price.
The ingredient names must match exactly, apart from capitals. "Flour " with a trailing space returns #N/A. The VLOOKUP function reference explains the arguments, and the VLOOKUP lesson lets you practise them.
Step 3: Total the batch cost with SUMPRODUCT#
Each line cost is quantity × cost per unit: =B2*C2 in D2, filled down. Add the column with SUM and you have the batch cost.
SUMPRODUCT does both in one formula, with no helper column:
=SUMPRODUCT(B2:B6,C2:C6)It multiplies each quantity by its unit cost and adds the results: 0.90 + 3.00 + 1.05 + 0.50 + 0.30 = 5.75. The two ranges must be the same size, or you get #VALUE!. The SUMPRODUCT function reference shows other uses, such as weighted averages.
Step 4: Calculate the cost per serving with ROUND#
Keep the summary in a small block to the right of the recipe: labels in column F, values in column G. Put the number of servings in G2, and in G3 divide the batch cost by it:
=ROUND(SUMPRODUCT(B2:B6,C2:C6)/G2,2)With 12 muffins, 5.75 / 12 = 0.47916..., and ROUND to 2 decimal places gives 0.48. ROUND changes the stored value, not just how it looks, so totals built on it add up to the cents you see. The ROUND function reference and the guide to ROUND, ROUNDUP and ROUNDDOWN explain when to round up instead.
If you build several recipes side by side and copy the summary formulas, write fixed cells such as the servings with $ signs, like $G$2, so they don't shift. The absolute references lesson practises exactly this.
Step 5: Find the food cost percentage and a menu price#
Food cost percentage is the share of the selling price that goes on ingredients:
=G3/G4If the cost per serving in G3 is 0.48 and the selling price in G4 is 2.50, the result is 0.192. Format it as a percentage to show 19.2%.
To go the other way and set a price from a target food cost, divide the cost by the target. With a 30% target:
=ROUND(G3/30%,2)The result is 1.60. Your target percentage is a business decision; 30% here is only an example. Food cost leaves out labour, rent and packaging, so check your full margin too. The guides to the profit margin formula and the markup formula show the difference between the two.
Allow for waste and trim#
Some ingredients lose weight before you use them: peel, bones, trimmings. The share you can actually use is called the yield. Add a Yield column to the Ingredients sheet and divide by it:
=B2/C2/F2If carrots cost 1.00 per 1,000 g and only 80% is usable after peeling (F2 = 80%), each usable gram costs 0.001 / 0.8 = 0.00125, not 0.001. Skipping yield makes recipes look cheaper than they are.
Common recipe costing mistakes#
- Mixing units. A pack size in kilograms with a recipe quantity in grams makes costs 1,000 times too big. Pick one unit per ingredient.
- Typing prices into the recipe. They go stale. Always look prices up from the Ingredients sheet.
- Leaving out FALSE in VLOOKUP. An approximate match on an unsorted list returns the wrong price without any error.
- Rounding the unit costs. Round only the final money results, such as cost per serving and menu price.
- Forgetting small items. Salt, oil and baking powder are cheap per recipe but add up across a menu. List them anyway.
For price lists with discounts and bulk prices, see price lists and discounts in Excel. For the other spreadsheets used in kitchens and hotels, read about Excel skills for hospitality jobs.
Practise it#
The calculator rests on three skills: an exact-match lookup, rounding and locked references. Practise VLOOKUP in a live spreadsheet, then practise ROUND, ROUNDUP and ROUNDDOWN. Each formula is checked instantly. Then try the exercise on this page to cost a muffin from scratch.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
This muffin batch makes the number of servings in D2. In D4, calculate the cost per serving: use SUMPRODUCT to multiply quantities (B2:B6) by cost per unit (C2:C6), divide by D2, and round to 2 decimal places with ROUND.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Servings | ||||
| 2 | |||||
| 3 | Cost per serving | ||||
| 4 | |||||
| 5 | |||||
| 6 | |||||
| 7 | |||||
| 8 | |||||
| 9 |
Tip: SUMPRODUCT(B2:B6,C2:C6) gives the batch cost. Divide it by D2, then wrap everything in ROUND(...,2).
Practise this in a lesson
Frequently asked questions
How do I calculate the cost of a recipe in Excel?
List each ingredient's cost per unit (pack price divided by pack size), multiply it by the quantity the recipe uses, and add the results. =SUMPRODUCT(B2:B6,C2:C6) does the multiplying and adding in one step.
How do I calculate cost per serving in Excel?
Divide the total batch cost by the number of servings, and round to cents: =ROUND(total/servings,2). For a 5.75 batch that makes 12 muffins, that's 0.48 each.
How do I calculate food cost percentage in Excel?
Divide the cost per serving by the selling price and format the cell as a percentage. A 0.48 muffin sold for 2.50 has a food cost of 0.48/2.50, which is 19.2%.
How do I set a menu price from a target food cost?
Divide the cost per serving by your target percentage. With a 0.48 cost and a 30% target, =0.48/30% gives a price of 1.60. Round it to a sensible menu price afterwards.
How do I include waste or trim in recipe costing?
Divide the cost per unit by the yield, the share you can actually use. If only 80% of a vegetable is usable after peeling, =cost_per_gram/80% gives the true cost of each usable gram.