Dollar-cost averaging calculator

This dollar-cost averaging calculator invests the same amount at each share or fund price you list and returns your average cost per unit next to the simple average of those prices. The two differ because equal amounts buy more units at low prices, which makes your cost the harmonic mean. It also compares one lump sum.

Switching currency changes formatting only. Amounts are not converted.

$
$1$1,000,000

Share or fund price at each purchase

One row per purchase, oldest first. Prices are typed in your currency and stay exactly as typed when you switch currency; nothing is fetched.

For shares that cannot be bought in fractions. Cash too small for one more share is carried to the next purchase.

$

Leave at 0 to use the last price in the list. The calculator holds no live prices.

Commission
$

A flat charge taken from each purchase. The lump-sum comparison pays it once.

Show the working

Know what your regular amount is buying

A fixed amount each month can go into a fund. The ETF Exchange Traded Funds Investing and Trading Course introduces exchange-traded funds, how they combine stock and mutual fund features, and how they are used in portfolio construction.

See the course

These are financial calculators made to make calculations easier and to help you find answers. They work only on the numbers you enter.

Trading stocks, forex, crypto and options carries a substantial risk of loss. This calculator does arithmetic on the numbers you enter and is not investment advice.

Worked example. Investing 500 dollars six times at prices of 100, 90, 75, 80, 95 and 110 buys 33.28 units for 3,000 dollars, an average cost of 90.14 a unit. The simple average of the six prices is 91.67, so the cost per unit is 1.66% lower. At 110 the units are worth 3,660.89 dollars.

Where the gap comes from

Average price against your average cost

The plain average of the prices so far, and what each unit has cost you so far.

Purchase by purchase

Units bought at each price and the two averages after each purchase.

Why is your average cost lower than the average price?

When the amount stays fixed and the price moves, the number of units you get moves the other way. A cheap month buys more units and an expensive month buys fewer, so the low prices carry more weight in your cost than in a plain average of the prices. The result is that your average cost per unit is the harmonic mean of the prices, not their arithmetic mean.

The smallest example shows it. Put $100 in at a price of $100 and $100 in at $50. The first buys 1 unit and the second buys 2, so $200 buys 3 units at $66.67 each. The average of the two prices is $75, yet nobody holding these units paid $75 for them. The harmonic mean, 2 / (1/100 + 1/50), is exactly $66.67.

For any list of prices that are not all the same, the harmonic mean sits below the arithmetic mean. So with equal amounts, whole money invested and no charges, the cost per unit comes in under the average price you would read off a chart. That is the whole effect, and it is arithmetic, not a forecast.

How do you calculate dollar-cost averaging?

Three steps. Divide the amount by each price to get the units bought that time. Add the units. Then divide the total invested by the total units: average cost = (amount x number of purchases) / sum of (amount / price). Because the amount cancels, this is the same as number of purchases / sum of (1 / price), the harmonic mean.

The default inputs invest $500 six times at prices of 100, 90, 75, 80, 95 and 110:

PurchasePriceUnits bought with $500
1$1005.0000
2$905.5556
3$756.6667
4$806.2500
5$955.2632
6$1104.5455

The $3,000 buys 33.2808 units, so the average cost is $90.14. The six prices add up to 550, an average of $91.67. Your cost is $1.52 a unit, or 1.66%, below that average. Valued at the last price of $110, the holding is worth $3,660.89, a gain of $660.89 or 22.03% on the money invested.

How much do price swings widen the gap?

The gap between the two averages depends on how far the prices move around, not on whether they rise or fall overall. Here are four lists of prices that all average exactly $100, with $100 invested at each:

PricesSimple averageAverage cost (harmonic mean)Cost below the average
100, 100, 100, 100$100.00$100.000%
90, 110, 90, 110$100.00$99.001.00%
75, 125, 75, 125$100.00$93.756.25%
50, 150, 50, 150$100.00$75.0025.00%

Swings of 10% either side cut the cost by 1%; swings of 50% either side cut it by a quarter. When prices alternate evenly around a level, the saving is the square of the swing: 0.10 squared is 1%, 0.25 squared is 6.25%. A steady price gives no saving at all. The panel chart under the result shows the same thing as bars: the lower the price, the taller the bar of units bought.

How exchange-traded funds combine stock and mutual fund features, and how they are used to build a portfolio, is the ground the ETF course covers. See the ETF Exchange Traded Funds Investing and Trading Course.

Dollar-cost averaging or a lump sum: what changes the answer?

A lower cost per unit than the average price is not the same as beating a lump sum. The calculator puts the whole total in at your first price and values both at the same price, so you can see each case.

  • Prices dip and recover (the default). $3,000 at the first price of $100 buys 30 units, worth $3,300 at $110. The six smaller purchases hold 33.28 units worth $3,660.89, because half the money went in below $100.
  • The same dip, valued lower. Enter 85 as the valuation price and the regular purchases are worth $2,828.87, a loss of $171.13 or 5.70%. The lump sum would be worth $2,550. Both lost money; the staged purchases lost less.
  • A steady rise. €300 at €20, €22, €24 and €26 buys 52.67 units at an average cost of €22.78, worth €1,369.55 at €26. Investing €1,200 at €20 would have bought 60 units, worth €1,560.00.

In a market that only rises, money invested earlier buys more units, so the lump sum ends ahead. The harmonic-mean effect still holds in that case: €22.78 is below the €23.00 average of the four prices. It just cannot make up for buying later at higher prices.

Whole shares, fractional units and commission

Funds and some platforms sell fractions of a unit, so every dollar is invested. Some shares can only be bought whole. Switch on Whole shares only and each purchase buys as many whole shares as the money allows, then carries the remainder to the next one.

On the default list, $500 buys 5 shares at $100, then 5 at $90 with $50 left, then 7 at $75 using that $50, then 6 at $80, 5 at $95 and 5 at $110. That is 33 shares and $20 of cash that never found a share. The cost per share is ($3,000 - $20) / 33 = $90.30, a little above the fractional $90.14 because the rounding steals some of the cheap months' extra units. The value at $110 is $3,650 including the $20.

A flat commission works against the averaging. A $5 charge on each of the six $500 purchases costs $30 and lifts the fractional cost to $91.05, still below the $91.67 average price. Make the commission large compared with the amount and it can push your cost above the average price; the calculator says so when that happens. The lump-sum line pays the commission once, so it ends at $3,294.50 against $3,624.28 for the regular purchases.

Worked example in pounds: a monthly fund purchase

The arithmetic does not care about the currency. A saver puts £200 a month into a fund priced at £4.00, £3.20, £2.50, £3.20 and £4.00, paying £1.50 commission each time. Each purchase invests £198.50, so the units are 198.50 x (1/4.00 + 1/3.20 + 1/2.50 + 1/3.20 + 1/4.00) = 302.7125.

The £1,000 put in therefore costs £3.30 a unit including commission. Before commission it is £3.28, which is the harmonic mean of the five prices, while their simple average is £3.38. The price ends where it started, at £4.00, yet the holding is worth £1,210.85, because the months at £2.50 and £3.20 bought more units. One £1,000 purchase at £4.00 with a single commission would be worth £998.50 at the same price.

Switch the currency selector to GBP, EUR, AED or any of 24 currencies and the formatting follows. Prices you type in the list stay exactly as typed, so enter them in the currency you chose.

How to calculate dollar-cost averaging in Excel or Google Sheets

Both spreadsheets have a harmonic mean function, which gives the cost per unit directly when the amount is the same each time. Put the prices in B2:B7 and the amount in E1. Then:

  • =HARMEAN(B2:B7) returns the average cost per unit: 90.14 on the default list.
  • =AVERAGE(B2:B7) returns the simple average price, 91.67, for comparison.
  • =E1*SUMPRODUCT(1/B2:B7) returns the units held, 33.28.

Microsoft's documentation notes that HARMEAN returns the #NUM! error if any value is zero or negative, so leave empty months out of the range rather than typing 0. With a commission, multiply the units by (amount - commission) / amount and divide the total invested by the result instead. If the amounts differ from month to month, HARMEAN no longer applies: use =SUM(amounts)/SUMPRODUCT(amounts/prices).

Dollar-cost averaging in the UK, US and elsewhere

The method is the same in every currency. It is also called pound-cost averaging, and the same idea applies to euros or dirhams. A regular monthly investment into a fund or a workplace plan that takes a set sum from each paycheck follows exactly the arithmetic on this page, whether or not the plan uses the name.

Tax is where countries differ. The average cost shown here is the plain figure across your purchases. Tax offices have their own rules for which cost applies when you sell part of a holding, and those rules can give a different number. The stock average calculator sets out how the UK, the US and Canada treat the average cost of shares, and the capital gains tax calculator estimates the tax on a gain by country.

Common mistakes and what this calculator leaves out

  • Quoting the average price as your cost. With equal amounts your cost is the harmonic mean, which is lower whenever prices moved.
  • Reading the gap as a return. A cost 1.66% below the average price says nothing about whether the holding is worth more than you paid.
  • Mixing in different amounts. HARMEAN only fits when every amount is equal; otherwise divide total money by total units.
  • Typing 0 for a skipped month. A zero price is left out here and breaks HARMEAN in a spreadsheet.
  • Ignoring charges on small amounts. A flat commission is a bigger share of $100 than of $1,000.

The calculator holds no prices of its own and makes no forecast. It does not add dividends, fund running costs, currency conversion or tax, and it assumes every purchase happens at the price you list. For the effect of a fund's yearly charge over time, see the fund fee calculator.

Glossary

Dollar-cost averaging: investing a fixed amount at regular intervals whatever the price. Arithmetic mean: the sum of the prices divided by their count. Harmonic mean: the count divided by the sum of 1 / price; the cost per unit of equal purchases. Average cost per unit: money invested, commission included, divided by units held. Fractional unit: part of a share or fund unit. Lump sum: the whole amount invested at once.

Frequently asked questions

How do I calculate my average cost with dollar-cost averaging?

Divide the total you invested by the total units it bought. With the same amount each time, that equals the number of purchases divided by the sum of 1 / price. $500 invested at 100, 90, 75, 80, 95 and 110 buys 33.28 units, an average cost of $90.14.

Why is my DCA cost lower than the average share price?

A fixed amount buys more units when the price is low, so low prices count for more in your cost. Your cost becomes the harmonic mean of the prices, which is always below the simple average when the prices differ.

What is the harmonic mean in dollar-cost averaging?

It is the number of prices divided by the sum of their reciprocals. For $100 invested at $100 and again at $50, it is 2 / (1/100 + 1/50) = $66.67, the true cost of each of the 3 units bought.

Is dollar-cost averaging better than a lump sum?

It depends on the path of prices. In the default list, which dips and recovers, staged purchases end $360.89 ahead of one purchase at the first price. In a steadily rising list the lump sum ends ahead, because money invested earlier buys more units.

Does dollar-cost averaging work with whole shares?

Yes, with some rounding. The whole-shares option buys as many shares as each amount allows and carries the leftover cash forward. On the default list that gives 33 shares at $90.30 each, with $20 left uninvested.

How do commissions affect dollar-cost averaging?

A flat commission comes out of every purchase, so it weighs most on small amounts. A $5 charge on six $500 purchases lifts the average cost from $90.14 to $91.05. A large enough charge can push the cost above the average price.

How do I calculate DCA in Excel?

With prices in B2:B7, =HARMEAN(B2:B7) gives the average cost per unit when every amount is the same, and =AVERAGE(B2:B7) gives the average price to compare. HARMEAN returns an error if any price is zero or negative.

What is pound-cost averaging?

It is another name for dollar-cost averaging: investing the same sum in pounds at regular intervals. The arithmetic is identical, and the calculator works in pounds, euros, dirhams and 21 other currencies.

Does dollar-cost averaging protect against losses?

No. It lowers your cost per unit relative to the average price, but the holding can still be worth less than you paid. Valued at 85, the default purchases show a loss of $171.13 on $3,000.

Is this the same as the crypto DCA calculator?

The arithmetic is shared, but this page is built for shares and funds. It adds a whole-shares option and a flat commission, and it sets your cost against both the simple and the harmonic average of the prices.

Courses for investing a fixed amount

ETF Exchange Traded Funds Investing and Trading Course

Introduction to exchange-traded funds, covering how ETFs combine stock and mutual fund features and how to use them for portfolio construction.

See what the course covers

Stock Market Trading Beginners Course

Structured online beginner program covering UK, USA, and European stock markets, technical analysis, fundamental analysis, risk management, and trading psychology.

See what the course covers

Fundamental Analysis Online Crash Course

Introductory course on evaluating companies before investing, covering fundamental analysis, business performance, market value, and practical stock selection methods.

See what the course covers

Sources and review

Last reviewed 14 November 2026 by the NIFM Academy editorial team. Next review by 14 May 2027.

  • Dollar-cost averaging arithmetic, units = (amount - commission) / price for each purchase; average cost = money invested / units; with equal amounts and no commission the average cost is the harmonic mean n / sum(1 / price), shown in the working under every result. Checked 14 November 2026.
  • Microsoft Support, HARMEAN function, HARMEAN(number1, [number2], ...) returns the harmonic mean of a data set; returns #NUM! if any data point is zero or negative. Checked 14 November 2026.
  • Google Docs Editors Help, HARMEAN, HARMEAN(value1, [value2, ...]) calculates the harmonic mean of a dataset in Google Sheets. Checked 14 November 2026.

About these calculators. These are financial calculators made to make calculations easier and to help you find answers. Every result is arithmetic on the figures you enter. It is not a forecast, and it is not a recommendation to buy, sell or hold any security, currency, fund or product. NIFM Academy is an online education provider.

Amounts are shown in the currency you choose and are never converted between currencies. Any rate, allowance or tax figure the page fills in is dated where it appears, and you can change it.