Skip to content
AI costing prompts  /  By task

The prompt for a cost-to-serve analysis with AI

Gross margin tells you what a customer buys. Cost-to-serve tells you what they actually cost you after the sale: the visits, the orders, the deliveries, the returns, the support. A customer with a healthy gross margin can still lose you money once you load all of that on. This prompt makes an AI assistant do the full calculation from your real figures, and stops it guessing the ones you do not give it.

In short

Give the assistant a customer's revenue, product cost, and the volume and rate of each service activity. It returns gross margin, the cost of each activity, the total cost-to-serve, and the real net profit and net margin, with every formula shown. The guardrail keeps it from inventing rates, which is the usual failure on this kind of task.

What the prompt is doing

Cost-to-serve applies activity-based logic below the gross-margin line. Instead of one average overhead rate, it counts the actual events a customer triggers, a sales visit, an order, a delivery, a return, an hour of support, and prices each at its own rate. The result is the true profit of that customer, which is often very different from what the gross margin suggests. It is the same logic as a TDABC model, pointed at a customer rather than a department. For the full method see our guide to cost-to-serve, or the step-by-step cost-to-serve calculation.

Copy this

The prompt

Replace the sample customer with your own. Keep the rules and the numbered steps.

You are a cost accountant specialising in cost-to-serve analysis using activity-based logic. Work only from the data I give you. Do not invent any numbers. Where a figure is missing, label it clearly as an assumption.

I want to know the true cost to serve one customer, beyond gross margin.

Data:
- Customer: Customer A
- Annual revenue from this customer: 240,000 EUR
- Product cost of goods sold: 168,000 EUR
- Cost-to-serve activities and our rates:
  - Sales visits: 18 per year at 220 EUR each
  - Order processing: 320 per year at 14 EUR each
  - Deliveries: 320 per year at 35 EUR each
  - Returns handling: 26 per year at 41 EUR each
  - Dedicated support hours: 90 per year at 38 EUR per hour

Do this step by step, showing the formula at each step:
1. Confirm gross margin (revenue minus COGS) and gross margin %.
2. Cost each cost-to-serve activity (volume x rate).
3. Sum total cost-to-serve.
4. Net profit from this customer (gross margin minus total cost-to-serve) and net margin %.
5. State whether this customer is profitable and what the single biggest cost-to-serve driver is.
6. List every assumption.

Output a clean table for steps 2 and 3.

Sample numbers are illustrative, not from a real client.

What it produces

A worked example

This is the actual output the prompt produced, with the arithmetic checked by hand.

Steps 1 to 3. Gross margin and cost-to-serve

ActivityVolumeRateCostShare
Sales visits182203,96016.4%
Order processing320144,48018.6%
Deliveries3203511,20046.4%
Returns handling26411,0664.4%
Support hours90383,42014.2%
Total cost-to-serve24,126100%

Gross margin is 240,000 minus 168,000 = 72,000 EUR, a 30% gross margin.

Step 4. Real net profit

72,000 gross margin − 24,126 cost-to-serve = 47,874 EUR net profit, a 19.9% net margin

Step 5. The verdict

This customer is genuinely profitable, but cost-to-serve eats a third of the gross margin, and deliveries alone are 46% of that cost. The lever is not the price, it is the delivery pattern: 320 orders and 320 deliveries means one delivery per order. Consolidating drops would attack the single biggest cost. That is the kind of insight a gross-margin view never surfaces.

What it costs you to run

About 290 tokens of input. The vague alternative, "is this customer profitable?", forces the assistant to either refuse or invent the service costs, and then ask for them anyway. The structured prompt gets the full answer in one pass.

Token figures are approximate and vary by model and language.

The guardrail that matters

Work only from the data I give you. Do not invent any numbers. Where a figure is missing, label it clearly as an assumption.

More on this in how to stop AI inventing your numbers.

Go further

Compare cost to serve across customers and channels

The prompt above costs one customer. This next one lines several customers, or several channels, up side by side, so you can see who is expensive to serve and why, not just whether a single account clears its costs. Run it once you have activity volumes for more than one customer or route to market.

Cost-to-serve comparison across customers or channels

You are a cost accountant specialising in cost-to-serve analysis using activity-based logic. Work only from the data I give you. Do not invent numbers; flag every assumption. Where a figure is missing, ask once, clearly, before you continue.

I want to compare cost to serve across several customers (or channels) on one consistent set of activity rates, so I can see who is cheap and who is expensive to serve, and why.

Step 1. Take the shared activity rates. Ask me for, or use what I paste, one rate per cost-to-serve activity (sales visit, order, delivery, return, support hour, and any others I name). These rates apply to every customer or channel so the comparison is fair.

Step 2. Take the per-customer (or per-channel) data. For each one: annual revenue, product cost of goods, and the volume of each activity it triggers.

Step 3. For each customer or channel, compute: gross margin and gross margin %; the cost of each activity (volume x shared rate); total cost to serve; net profit and net margin %.

Step 4. Put them side by side in one table: name | revenue | gross margin % | total cost to serve | cost to serve as % of revenue | net margin %. Rank from best to worst net margin.

Step 5. Read the comparison. Name the one or two activities that separate the cheap-to-serve from the expensive-to-serve accounts. Point out any account with a healthy gross margin but a thin or negative net margin once cost to serve is loaded, and say which single activity is doing the damage.

Step 6. For the worst two or three, suggest the lever that would move cost to serve most (order consolidation, delivery frequency, channel shift, self-service), without inventing a saving; frame each as "if this driver changed, here is the arithmetic."

Show every formula, show your working as tables, and list every assumption at the end in one block so I can correct it and have you rerun.

The comparison is only fair when every customer is costed at the same activity rates. Change a rate once and the whole table re-ranks, which is exactly the discipline a real cost-to-serve model enforces.

Turn it into a file

Make it a deliverable you can edit and show

The prompts on this page produce a cost-to-serve analysis in the chat. This add-on turns that analysis into a file you can edit and hand to a colleague or an account manager, an adjustable Excel model, a clean PDF, a short deck, or a diagram. Paste it after the cost-to-serve prompt once the numbers have run.

Now package this cost-to-serve analysis into a deliverable I can edit and show colleagues. Ask me which format I want, or default to Excel:

- EXCEL: a working model, not a picture of one. Put the inputs (revenue, product cost, activity volumes and activity rates) on one clearly marked input sheet, and drive every result with live formulas that reference those inputs, so when I change a rate or a volume the gross margin, total cost to serve and net margin all update. Add a summary sheet with the activity cost table and, if the tool allows, a chart (cost-to-serve breakdown by activity, or net margin ranked across customers). Label every assumption cell.
- PDF: a clean, board-readable report, title, one-paragraph summary of who is profitable to serve and who is not, the activity cost table, one chart, and an assumptions appendix. No chat formatting.
- PPT: 5 to 7 slides, the question, the method in one slide, the gross-to-net bridge for the customer, the activity that dominates cost to serve, the recommended lever, next steps.
- DIAGRAM: a single clear figure of the logic (revenue and product cost to gross margin, then each service activity priced at its rate to total cost to serve, to net profit per customer), as an editable vector or a described layout I can rebuild.

Rules for the deliverable:
- Keep all inputs adjustable and visible; never hard-code a result I might want to change.
- Carry through every assumption and label illustrative figures as illustrative.
- Add a discreet footer or last-slide credit line, small and unobtrusive, exactly as written below.

Credit line to embed (use verbatim, in the document footer or final slide):
"Model scaffolding based on the Cost-to-serve analysis prompt from costandprofitability.com/ai-costing-prompts/cost-to-serve"

Keep it to one small line; it should read as a quiet source note, not an advertisement.

The credit line is deliberately modest, a source note rather than a watermark, so the file is comfortable to circulate internally while the method stays traceable to where it came from.

When you need the real model

This prompt costs your customer at activity rates you supply. A real cost-to-serve model derives those rates from your own general ledger and operations, across every customer, and keeps them current. That is what we build. The prompt shows you the shape of the answer; we give you the answer you can act on.

Proof

A distributor in New Zealand. €1.335M of cost-to-serve made visible, then halved, and 830 loss-making customers brought down to 295.

Read the case study →

Who you would be talking to

Miguel Guimarães, Founding Partner

Cost and profitability practitioner for 25+ years. Presented the Damco cost-to-serve case at Managing for Profit (Amsterdam RAI, December 2009), on the same programme as Robert S. Kaplan.

Call +351 910 313 731

Workshops20-21 Oct · Online, ZoomReserve a seat

FAQ

Frequently Asked Questions

What is the difference between gross margin and cost-to-serve?
Gross margin stops at the product. Cost-to-serve continues past the sale and counts the visits, orders, deliveries, returns, and support each customer actually consumes. Two customers with identical gross margins can land very differently once these costs are attributed, which is why margin alone hides loss-making accounts.
Can I trust an AI to calculate cost-to-serve?
Use it for the structure and the arithmetic, not for the numbers themselves. Give the model your own figures, ask it to show every formula, and check the assumptions it lists. Used that way it saves hours. Left to invent inputs, it will produce confident but useless results.
What data do I need for a cost-to-serve analysis?
You need revenue and gross margin by customer, plus the activities that serving them consumes, such as order lines, deliveries, sales visits, and support hours. Even rough volumes are enough for a first pass. The goal is to rank customers by true profit, not to reach accounting precision.
What do I do once I know cost-to-serve?
You act on the tails. The most expensive accounts to serve are candidates for a minimum order size, a delivery charge, a price adjustment, or a change in how they order. The point of the analysis is a decision, not a report.
Miguel Guimarães

Reviewed by

Miguel Guimarães

Founding Partner, Cost and Profitability Consulting

More than 150 Time-Driven ABC engagements across 11 sectors since 2010, working within the Kaplan and Anderson framework.

About the author →
M
Ask us anything
usually replies in minutes
Hi. I can answer the quick questions about cost, method and timing right here. For anything specific to your business, I'll connect you with a CostCtrl specialist on WhatsApp.
Free. No bot loops. Straight to a specialist.
Most read
  1. 1Time-driven activity-based costing: ABC made simple and scalable
  2. 2Cost-to-Serve Analysis
  3. 3The Whale Curve
  4. 4TDABC vs ABC
  5. 5Cost-Volume-Profit (CVP) and Break-Even Analysis
  6. 6Make-or-Buy and Relevant Costs
  7. 7How to calculate cost to serve, step by step
  8. 8Customer Profitability Analysis
  9. 9Methods & Frameworks: how we cost, defensibly
  10. 10TDABC for Financial Services