Food Product Costing: AI-Built Batch, Yield Loss and Margin Sheet

Coding Liquids tutorial cover featuring Sagnik Bhattacharya for Food Product Costing: AI-Built Batch, Yield Loss and Margin Sheet.
Coding Liquids tutorial cover featuring Sagnik Bhattacharya for Food Product Costing: AI-Built Batch, Yield Loss and Margin Sheet.

Cost a food product by adding ingredients (priced per usable kilogram, after trim and cook-off loss), packaging, labour minutes and a share of overheads for one batch, then divide by the units you can actually sell. AI can build the sheet and read invoices; your batch weights and invoices supply the numbers.

The common error is costing from the recipe card: the quantities in the pot, bought at the invoice price, divided by an ideal number of units. Real batches lose weight to trimming and evaporation, lose units to the pot and the reject bin, and lose time to cleaning. Below, one wholesale product goes through every loss, then its margin is compared across four channels.

Follow me on Instagram@sagnikteaches

The example: a tomato and chilli relish in 300 g jars

Everything below is illustrative: a small maker cooks one 40 kg tomato batch of relish at a time in a rented kitchen and sells it in 300 g jars. Swap in your own prices and weights. The sheet has seven blocks, and the order matters because each block feeds the next.

Connect on LinkedInSagnik Bhattacharya
  1. An ingredient price list, with usable cost per kilogram.
  2. The recipe, in raw purchased quantities.
  3. The yield walk, from raw weight to jars.
  4. Packaging per jar and per carton.
  5. Labour in minutes, per person per task.
  6. Overheads per batch.
  7. Pricing and margin by channel.

Block 1: price every ingredient per usable kilogram

Invoices come in cases, sacks and litres. The first job is to turn each into a price per kilogram, then adjust for what is thrown away. Usable cost per kilogram is the purchase price per kilogram divided by the usable share (one minus trim loss).

Subscribe on YouTube@sagnikteaches
IngredientBoughtPriceTrim lossUsable cost per kg
Tomatoes40 kg$1.80/kg = $72.0012%$2.05 (1.80 / 0.88)
Onions6 kg$1.20/kg = $7.2010%$1.33
Sugar8 kg$1.10/kg = $8.800%$1.10
Vinegar6 L, treated as 6 kg$1.50/L = $9.000%$1.50
Fresh chilli1.2 kg$9.00/kg = $10.8015%$10.59
Salt and spices0.5 kg$4.50 total0%$9.00
Ingredient total$112.30

Note the tomato line: the invoice says $1.80 a kilo, but the kilo that reaches the pot costs $2.05. The 4.8 kg trimmed away is $8.64 of the $72 tomato bill: $72 buys only 35.2 kg of usable fruit, which is where the $2.05 comes from. Vinegar is bought by volume; treating a litre as a kilogram is a small simplification that you should check against your supplier's data for your product.

The Complete Excel Course with AI Integration thumbnail

The Complete Excel Course with AI Integration

From formulas and pivot tables to Power Query, DAX, VBA and AI with Copilot, ChatGPT and Claude — hands-on from the first lesson.

By Sagnik Bhattacharya and Virginia Thorn, Primetime Emmy Award winner

Buy now

Block 2 and 3: from raw weight to jars

Add up what is in the pot after trimming: 35.2 kg tomatoes, 5.4 kg onion, 8 kg sugar, 6 kg vinegar, 1.02 kg chilli and 0.5 kg salt and spices, which gives 56.1 kg. Now follow the weight down:

  1. Cook-off: relish is reduced by boiling, and the batch loses about 30% of its weight to evaporation (a measured figure, from weighing before and after on three batches). 56.1 kg becomes 39.3 kg.
  2. Left in the pot and tasting: 1.5 kg stays in the vessel, hoses and sample pots. That leaves 37.8 kg.
  3. Jars filled: at 300 g net, 37.8 kg fills 126 jars.
  4. Rejects: two jars fail on a poor seal or a crooked label. That leaves 124 jars to sell.

So 40 kg of tomatoes turned into 124 sellable jars: the recipe card might have implied 140 or more. The yield walk is where costing sheets usually go wrong, and the only reliable fix is to weigh. Record the weight into the pot, the weight coming out and the number of jars filled on every batch for the first ten batches, then use the average.

Block 4: packaging, counted per jar and per carton

Packaging is bought for every jar filled, including rejects. Per jar: glass jar $0.42, lid $0.11, label $0.09 (about $0.62 together). Cartons hold 12 jars and cost $1.80 each. For the batch: 126 jars at $0.62 is $78.12, plus 11 cartons ($19.80) for 124 jars, which makes $97.92. That's $0.79 per sellable jar. If a retailer wants a tamper-evident seal or a shelf-ready tray, add those lines here, not in overheads.

Block 5: labour in minutes, by task and by person

Write labour as person-minutes, because one task can use two people. Illustrative times for the batch:

TaskPeopleMinutes eachPerson-minutes
Washing, trimming, chopping260120
Cooking and stirring1150150
Filling and capping290180
Labelling and boxing19090
Clean-down23060
Total600 (10 hours)

At a loaded rate of $21 an hour (wage plus employer costs such as holiday and contributions; check what yours really is), labour is $210 a batch, or $1.69 a jar. If the owner does the work unpaid, put in a wage anyway for the costing. A product that only works at zero labour cost will not survive the first hire.

Block 6: overheads per batch

Overheads are what the batch uses that is not an ingredient, package or wage. Allocate them by batch or by hour. Illustrative: gas for the cook, $9; kitchen rent of $500 a month shared across 20 batches, $25. That's $34 a batch, or $0.27 a jar. Other candidates are insurance, testing and shelf-life checks, certification fees and software; add the ones that are real, spread over the batches in a year.

The batch total and the cost per jar

Ingredients $112.30, packaging $97.92, labour $210.00 and overheads $34.00 add up to $454.22 a batch. Divide by 124 sellable jars: $3.66 a jar. Of that, ingredients are $0.91, packaging $0.79, labour $1.69 and overheads $0.27. Labour is the largest line in this example, so batch size and efficiency matter more than a cheaper tomato.

Now test what a small change does. If the cook-off is 33% instead of 30%, the batch yields about 120 jars filled and 118 sold. Packaging for 120 jars and 10 cartons drops slightly, but the cost per sellable jar still rises to about $3.80, 14 cents more from three percentage points of evaporation. Over 20 batches a year that is about $330. Nothing in the recipe changed; the yield measurement did.

Block 7: margin by channel

The same jar earns very different margins depending on who buys it, because each channel has its own extra costs. Margin here is (price minus all costs) divided by price.

ChannelPrice per jarProduction costChannel costsMargin per jarMargin %
Own market stall$7.00$3.66$0.75 (stall fee spread over 80 jars)$2.5937.0%
Wholesale to shops$5.20$3.66$0.30 (delivery)$1.2423.8%
Distributor$4.40$3.66$0.10 (pallet and handling)$0.6414.5%
Online direct$8.50$3.66$1.24 ($0.90 shipping pack, $0.34 payment and platform fees at 4%)$3.6042.4%

Two things leap out. First, wholesale earns less per jar ($1.24) than the stall, but it brings volume, and volume is what fills the kitchen. Second, the distributor price barely covers cost, so selling there only makes sense if a bigger batch cuts labour per jar. To test that, suppose a double batch needs 15 person-hours rather than 20 (the cooking and cleaning barely grow), so labour is $315 for 248 jars, $1.27 a jar instead of $1.69. That cuts the cost per jar to roughly $3.24 and lifts the distributor margin to about $1.06, around 24%. Check any such saving with a real trial, since a double batch needs a bigger pot and may not cook off at the same rate.

Building the sheet with AI

A chat assistant is good at turning your block list into a spreadsheet layout with working formulas. Give it the structure, not a vague request.

Build a batch costing sheet for a food maker, as plain spreadsheet tabs with formulas I can paste.
Tabs: Ingredients (name, pack size kg, pack price, trim loss %, usable cost per kg = price per kg / (1 - trim loss)); Recipe (ingredient, purchased kg, cost = purchased kg x price per kg); Yield (kg in pot after trim, cook-off %, left in vessel kg, jar net weight kg, jars filled = (kg x (1 - cook-off) - left in vessel) / jar weight, rejects, sellable jars); Packaging (per jar items, per carton items, jars per carton); Labour (task, people, minutes each, loaded hourly rate); Overheads (monthly cost, batches per month); Channels (price, channel cost per jar, margin and margin %).
Give the cell references and formulas, then fill the sheet with this data and show every intermediate result: [paste data]
Do not invent numbers. If an input is missing, ask.

Check the first formula by hand, then copy the sheet into a normal spreadsheet so the calculating is done there. The assistant's own arithmetic in the chat is a convenience, not the record.

Reading supplier invoices into the price list

This is the other task AI does well, and the most error-prone. Upload an invoice or paste its text and ask for item, pack size, units per case and price, in a table. A realistic slip: the invoice line reads "Sugar, white, 6 x 2 kg bags, $13.20" and the assistant returns "Sugar, 6 kg, $13.20", which gives $2.20 a kilogram, when it should be 12 kg and $1.10. The fix is a rule in the prompt ("multiply pack count by unit size and show the working") plus a check column that recalculates price per kilogram and flags anything more than 20% away from last month's figure. Updates to a recipe or supplier specification can change costs and labels at once; spotting supplier specification edits covers the label side of the same change.

When prices, jar sizes and recipes change

A price rise on a key ingredient

Tomatoes go up 25%, from $1.80 to $2.25 a kilo. The batch rises by $18 (40 kg at $0.45), about $0.15 a jar, so wholesale cost goes from $3.96 (including delivery) to $4.11. To hold the 23.8% margin you would need a price of about $5.39, an increase of 19 cents. Because every product reads from the ingredient list, you change one cell and see every affected product at once.

A smaller jar for a new retailer

A retailer asks for a 190 g jar. Do not scale the price by weight. Ingredients scale down, but jar, lid, label and filling time do not, and the labour per jar is nearly the same. Run the smaller jar through the same sheet before quoting.

A seasonal recipe change

A bumper crop of cheaper tomatoes lets you cut the sugar. Rather than guess, change the recipe tab and look at both cost and, separately, whether the cook-off changes; less sugar can mean more evaporation to reach the same texture, and a shelf-life or acidity check may be needed before you sell the new version. That check is a food-safety decision for you and whoever signs off your process, not a spreadsheet one.

Comparing a menu or a product set

If you cost for a canteen rather than a jar, the method is the same with portions instead of jars. A menu cycle with costs and allergens shows it for catering, and the cost of delivering to buyers can be worked out the same way as in cost per drop for delivery.

A costing mistake that looked like a pricing success

One illustration. A maker prices a new granola at the same margin as an older product and sells well for two months, then finds monthly profit has fallen. The recipe card said 12 kg of mix gives 40 bags of 300 g. In practice the oven drives off about 10% of the weight, leaving 10.8 kg, and the filler over-fills each bag by 8 g to be safe, so 10.8 kg makes 35 bags, not 40. That's 12.5% fewer bags from the same ingredients and the same labour, and a cost per bag about 14% higher than the sheet said. The weigh-in and weigh-out columns would have shown it in the first batch. Treat the fill target as a cost lever: a tighter filler and a check-weigher cost money once; overfill costs money every day.

Turning a cost into a price, with a target margin

Once the cost per jar is trustworthy, pricing is one line of arithmetic. To earn a target margin, divide the full cost by one minus the margin. For a 35% margin on the wholesale channel, with a production cost of $3.66 and $0.30 delivery: $3.96 divided by 0.65 is $6.09. That is $0.89 above the $5.20 in the table, which tells you the wholesale price needs to rise or the cost needs to fall before wholesale reaches the same margin as the market stall. Express the gap in both directions. A $0.89 rise is a 17% price increase, hard to win from a retailer. Holding the price at $5.20 instead means the full cost must fall to $3.38 ($5.20 × 0.65), a cut of $0.58 a jar; if it all came from labour, that is $1.69 down to about $1.11, lower than even the double batch's $1.27. Seeing both numbers is what lets you decide whether to push the price, change the batch size or accept a lower margin in return for volume.

Ask the assistant to produce this "required price" column for every channel from the margin you choose, and to show the arithmetic. It is a good use of its speed, as long as you confirm one line by calculator.

Shelf life, waste and stock you cannot sell

Jars that expire unsold are cost too. Add a waste percentage to the channel block if you see it: a maker who loses 3% of production to short-dated or damaged stock should divide the sheet's cost by 0.97 for the channels where it happens. A product with a short shelf life, such as fresh dips or filled rolls, needs a batch size driven by what will sell before the date. The same sheet can test it: reduce the batch to 60% and see how labour per unit rises against the waste you avoid. Label checks belong beside this, since a wrong date code is both a safety issue and a write-off.

Month-end check against the accounts

A costing sheet is a model; the accounts are what happened. At month end, compare three figures: ingredients and packaging bought (from invoices, adjusted for stock change), the number of batches made multiplied by the sheet's ingredient and packaging cost per batch, and the difference. If the actual is more than about 5% above the model, ask where the gap comes from: rejects not logged, a price that changed, product given away, or a yield shortfall. Paste the two columns into an assistant and ask it to list the likely reasons in order of size, clearly marked as hypotheses to check, since it knows only what you give it. Then check each against your batch sheets.

Proving the costing sheet against real batches

  1. Cook three real batches and record weights in and out, jars filled and time taken. Compare with the sheet's assumptions and replace them with the averages.
  2. Recalculate one ingredient's usable cost and one channel's margin by hand.
  3. Compare total ingredient and packaging spend for a month, from your accounts, with batches multiplied by the sheet's cost per batch. A gap of more than about 5% means a missing cost or a yield error.
  4. Set a reminder to review the price list quarterly, and whenever a supplier changes a price.
  5. Show the sheet to your accountant once, so the overhead allocation agrees with how the books treat it.

If you'd like someone to help wire this to your invoices and recipes, that is what my AI implementation consultation covers.

Questions small food makers ask about costing

Do I cost on ingredients bought or ingredients used?

Cost on what ends up in the product. If you buy 40 kg of tomatoes and 12% is trimmed away, the usable kilogram costs more than the invoice price. Divide the purchase cost by the usable quantity, then use that figure in every recipe.

How do I measure yield loss accurately?

Weigh the product going into the pot and the finished product coming out, on at least three batches, and record both on the batch sheet. Average the results and use a range for planning. AI can total the figures but can't guess how your recipe behaves.

What margin should a wholesale food product earn?

There is no single right figure. It depends on your channel, volume and overheads. Work out what margin you need to cover overheads and pay yourself, then test each channel against it. The worked example shows margins from about 14% to over 40% on one product.

Can ChatGPT or Claude read my supplier invoices?

Yes. Both accept PDF and image uploads, so from a clear invoice they can pull out item, pack size and price. Always verify against the invoice, since a misread pack size (6 x 2 kg read as 6 kg) changes the cost a lot. Keep the invoice as the record.

How often should I recost?

Recost whenever a main ingredient price or the packaging cost changes by more than a few percent, and in any case every quarter. A sheet driven by an ingredient price list lets you change one cell and see every product's cost update.

Further reads

Sources: standard recipe-costing and yield-testing practice for food manufacturers; OpenAI's help centre (Uploading files and audio to ChatGPT) and Claude's help centre (Uploading files to Claude) on PDF and image uploads, checked 5 November 2026. All prices, yields and wages in the worked example are illustrative; use your own invoices and batch weights.

Want your product costs to update themselves?

On a 1:1 call we'll look at your recipes and supplier invoices, set up a costing sheet that recalculates when a price changes, and decide which steps AI should handle.

Book a 1:1 call with me