Opportunity Cost Formula: Worked Examples and Graph Calculations

October 3, 2026 Updated: October 20, 2026 · By Taylor Yang · #mental models #decision-making

Choose the right opportunity cost formula, work through a numerical example, and calculate units forgone from a graph without confusing cost with a return gap.

A hand places a coin where a path forks: one branch leads to a house and garden, the other to an easel beside an empty circle.

In 1817, David Ricardo published a puzzle built from four numbers. A fixed amount of cloth took the labour of 100 men for a year in England and 90 in Portugal. A fixed amount of wine took 120 men in England and only 80 in Portugal. Portugal was better at both. Ricardo still argued that Portugal should import its cloth.

The opportunity cost formula depends on the question. For a choice, opportunity cost is the value of the best feasible alternative you give up. For a trade-off between two goods, divide the units given up by the units gained. Subtracting one return from another gives a return gap, which is a different number.

Ricardo’s puzzle is one division

Ricardo never used the phrase “opportunity cost.” Modern textbooks still teach his example with it, because the per-unit formula solves the puzzle:

CountryLabour for the clothLabour for the wineOpportunity cost of the wineOpportunity cost of the cloth
England100 men-years120 men-years120 ÷ 100 = 1.2 cloth100 ÷ 120 ≈ 0.83 wine
Portugal90 men-years80 men-years80 ÷ 90 ≈ 0.89 cloth90 ÷ 80 = 1.125 wine

When England makes the wine, the labour it uses could have made 1.2 units of cloth. Portugal gives up only 0.89 cloth for the same wine. So wine is cheaper in Portugal and cloth is cheaper in England, measured in what each country sacrifices. Ricardo’s conclusion follows: “England would give the produce of the labour of 100 men, for the produce of the labour of 80.”

Comparing labour hours alone made Portugal look better at everything. Writing the cost in units of the other good made the right specialization obvious. The rest of this guide applies that lesson: pick the formula that answers your question, and keep the units attached.

Three formulas for three questions

QuestionCalculationWhat the answer means
What am I giving up by choosing A?Value of the best alternative to AThe forgone value
How much more return would B provide than A?Return from B − return from AThe relative return gap
How much Y do I give up for each additional X?Units of Y given up ÷ additional units of XOpportunity cost per unit of X

You may see OC = FO − CO, where FO is the return from the forgone option and CO is the return from the chosen option. That subtraction compares two returns. Under the next-best-alternative definition used by OpenStax, FO itself is the forgone value. Write which quantity you mean before you calculate.

One selected option sits beside the best feasible alternative, while a weaker alternative is set farther away
One selected option sits beside the best feasible alternative, while a weaker alternative is set farther away

Identify the best feasible alternative; do not add up every rejected choice.

Forgone value versus return gap

Take a fictional one-year comparison of net returns, after each project’s relevant costs:

ProjectIllustrative net returnStatus
A$600Chosen
B$900Best alternative
C$400Other alternative

Choosing A forgoes B’s $900 net return. The return gap is $900 − $600 = $300. Adding B and C to get $1,300 would count two alternatives you could never have done together. Calling $300 the entire value forgone would mix the two questions.

Calculate it in five steps

  1. State the choice and resource. For example: “Which project gets our one available machine next week?”
  2. List the realistic alternatives. Include doing nothing if it is a real option. Remove anything that breaks the budget, deadline, or capacity.
  3. Choose a common comparison basis. Use the same period and consistent gross or net figures. If you use net benefits, do not subtract the same costs again.
  4. Find the best alternative you would give up. With mutually exclusive projects, this is one alternative. A combination counts as one alternative only if you could actually carry it out.
  5. Calculate and label the answer. Say “$900 forgone net return,” “$300 return gap,” or “3 units of Y per additional X.” Record assumptions beside it.

If the result depends on a forecast, rerun it with a less favorable assumption. A precise subtraction does not make an uncertain input reliable. Second-order thinking helps find consequences missing from the first comparison.

Read opportunity cost from a graph

On a production possibilities frontier, getting more of one good means giving up some of another. The ratio is the same one Ricardo’s numbers needed:

Opportunity cost of X = decrease in Y ÷ increase in X.

This is the units-given-up divided by units-gained method taught in introductory economics. Read the axis labels first, because reversing the direction changes both the numerator and the units.

Consider this fictional frontier, drawn as straight segments between the listed points:

PointUnits of XUnits of Y
A218
B412
C62
A fictional production frontier connects A at 2 X and 18 Y, B at 4 X and 12 Y, and C at 6 X and 2 Y
A fictional production frontier connects A at 2 X and 18 Y, B at 4 X and 12 Y, and C at 6 X and 2 Y

From A to B, 6 Y buys 2 extra X. From B to C, 10 Y buys the same 2 extra X.

  1. A → B: give up 18 − 12 = 6 Y; gain 4 − 2 = 2 X. Cost = 3 Y per X.
  2. B → C: give up 12 − 2 = 10 Y; gain 6 − 4 = 2 X. Cost = 5 Y per X.
  3. A → C: give up 16 Y; gain 4 X. The average across both segments is 4 Y per X.

The cost rises from the first segment to the second, and the 4 Y average does not mean every extra X costs exactly 4 Y. Ricardo’s countries had constant costs, which would draw a straight line. Rising costs like these are the subject of the law of increasing opportunity cost.

Going back from B to A gives up 2 X to gain 6 Y, so the reverse cost is 1/3 X per Y. That is the reciprocal in different units, and it does not contradict the first answer.

When the formula misleads

Comparing totals instead of ratios. Portugal’s lower labour counts hid the real answer. Two options can differ in total cost while the sacrifice per unit points the other way.

Adding every rejected choice. Use the single best alternative you could really have taken. An impossible bundle of everything you turned down is not a cost you faced.

Pricing every hour at your wage. An evening is worth your hourly rate only if paid work was actually available and you would have taken it.

Counting sunk costs. An unrecoverable fee is the same under every option, so it cannot separate them. See sunk cost fallacy vs opportunity cost.

Trusting the model’s assumptions. Ricardo’s example ignores transport costs, other inputs, and rising costs. A clean ratio is only as good as the conditions behind it.

A worksheet for your own trade-off

FieldFill in
Choice and limited resourceWhat can only be used once?
Feasible optionsWhat could I actually do?
Chosen optionWhich option am I evaluating?
Best alternativeWhat would I otherwise choose?
Comparison basisSame period, units, and treatment of costs
Forgone valueValue of the best alternative
Optional return gapAlternative value minus chosen value
Uncertain assumptionWhat could change the ranking?
A trade-off notebook keeps the chosen option, best alternative, and comparison units visible together
A trade-off notebook keeps the chosen option, best alternative, and comparison units visible together

Keep the choice, the alternative, and the units in the same record.

For practice, choose P with a net benefit of $80 when the other options, Q and R, offer $110 and $65. The forgone value is $110; the return gap is $30. You do not add Q and R. When several criteria matter, pair the worksheet with decision-making frameworks.

Frequently asked questions

What is the formula for opportunity cost?

For a choice, find the value of the best option you could actually have taken instead. For a per-unit trade-off, divide what you give up by what you gain. Subtracting the chosen return from the alternative return gives a comparison gap, so label it that way.

How do you calculate opportunity cost with a graph?

Read two points and the axis units. Divide the reduction in the forgone good by the increase in the desired good. On a curved frontier, a ratio between two points is an average over that interval.

What is a famous example of opportunity cost?

Ricardo’s England and Portugal. England’s wine cost 1.2 units of cloth; Portugal’s cost about 0.89. That gap, not total labour, decides who should make what. For the core idea, see opportunity cost.

Your 5-minute opportunity cost check

Choice:
Limited resource (money / hours / machine time):
Best feasible alternative (one, not a bundle):
Question I'm answering: forgone value / return gap / per-unit cost
Answer, with units:
Assumption that could flip the ranking:

To check the arithmetic, paste the filled card into a prompt from Save Effort and ask it to verify the units and spot any alternative you counted twice.