Calculate opportunity cost as the return of the best alternative minus the option you chose, or compare investments, spending and two projects by NPV.

Discounting and sensitivity
Optional; supply a horizon to discount all compared returns to present value.

Illustrative variation, not a probability or confidence interval.

Calculator Functions

FunctionWhat it doesWhat it requires
Opportunity cost (best alternative minus chosen)Finds the return given up by choosing one option over the best alternativeRequires the return on the best alternative and the return on the chosen option, in dollars
Alternative returnFinds the return the best alternative would have paidRequires the chosen return and the return difference
Chosen returnFinds the return on the chosen optionRequires the best alternative return and the return difference
Investment comparisonProjects two investments of the same money at different annual returns and finds the gap between them in today’s dollarsRequires the initial investment, the horizon in years, both annual returns and a contribution frequency. Fees, tax and inflation are optional
One-time spending versus investingFinds what a single purchase would have grown to if the money had been investedRequires the spending amount, the horizon in years and the annual return. Tax and inflation are optional
Recurring spending versus investingFinds what a repeated expense would have grown to if each payment had been investedRequires the spending amount, its frequency (monthly, weekly or daily), the horizon in years and the annual return. Tax and inflation are optional
Project NPV and IRRCompares two projects by net present value and shows how far the chosen one falls short of the better oneRequires the annual discount rate, the chosen project and the year 0 outlay of each project. Cash flows for years 1 to 6 are optional

The first three functions accept an optional discount rate with a horizon in years, and an optional sensitivity range in percent. Blank fees, tax, inflation, contributions and yearly cash flows count as zero.

Opportunity Cost Formulas

OC = RB − RC [1]
OCOpportunity cost: the return given up ($)
RBReturn on the best alternative ($)
RCReturn on the chosen option ($)

Opportunity cost is the value of the most highly valued alternative given up when a choice is made [1]. The calculator measures it in money, as the gap between two returns for the same date and currency. A negative result means the chosen option pays more than the alternative.

Opportunity cost (best alternative minus chosen)

The main formula applies directly: a best alternative returning $5,000 against a chosen return of $3,000 is an opportunity cost of $2,000.

PV = FV ÷ (1 + r)n [2]

With a discount rate r and a horizon of n years, both returns are first brought back to present value [2]. At 5% over 2 years, $5,000 and $3,000 become $4,535.15 and $2,721.09, and the opportunity cost becomes $1,814.06. A sensitivity range of ±10% shows each return 10% lower and 10% higher. It is an illustration, not a probability.

Alternative return

RB = RC + OC

A chosen return of $3,000 with a difference of $2,000 means the alternative returned $5,000.

Chosen return

RC = RB − OC

An alternative return of $5,000 with a difference of $2,000 means the chosen option returned $3,000.

Investment comparison

i = (1 + R − F)1/12 − 1

R is the annual return and F the annual fee, both as decimals, and i is the monthly rate. Each balance grows by i every month, tax is taken from positive monthly gains only, and any contribution is added at the end of its month or year. The horizon is rounded to whole months. With no contributions, fees or tax this is FV = P × (1 + R)n: $10,000 for 10 years grows to $14,802.44 at 4% and $19,671.51 at 7%, a difference of $4,869.07. With inflation entered, each future value is divided by (1 + inflation)n to give today’s dollars.

One-time spending versus investing

FV = A × (1 + R)n

A is the amount spent. The result is the whole future value given up, the amount plus its growth, and it does not put a value on what was bought. Spending $1,000 now instead of investing it at 7% for 10 years gives up $1,967.15, or $1,613.75 in today’s dollars at 2% inflation.

Recurring spending versus investing

FV = C × ((1 + i)N − 1) ÷ i

C is the spending per month, N is the number of months and i is the monthly rate from the Investment comparison formula. Weekly spending is multiplied by 52 ÷ 12 and daily spending by 365 ÷ 12 to get C, and each month’s amount is treated as invested at the end of the month. Spending $100 a month for 10 years at 7% gives up $17,105.17, of which $12,000 is the money spent.

Project NPV and IRR

NPV = Σ CFt ÷ (1 + r)t [2]

CFt is the cash flow in year t, from the outlay in year 0 to year 6, and r is the discount rate [2]. The result is the higher of the two NPVs minus the NPV of the chosen project. At 10%, Project A with −$1,000, $600 and $600 has an NPV of $41.32, and Project B with −$1,000 and three payments of $400 has an NPV of −$5.26, so choosing B costs $46.58. The IRR is the discount rate at which NPV is zero [2], 13.07% for Project A. It is reported only for a negative outlay followed by inflows, because flows that change sign more than once can have several IRRs [2].

Limits of This Estimate

  • Only money is compared. Opportunity cost in economics also covers time, enjoyment and other things that have no price.
  • The investment functions are scenarios at a constant return. They are not a forecast or a guaranteed return, and the tax is a simplified monthly charge on gains with no credit for losses.
  • Project NPV and IRR compares only the two projects entered. It does not consider doing neither, and the IRR on its own is not a sound way to rank projects [2].

Sources