
Learn how to calculate portfolio returns accurately. This guide covers time-weighted (TWR) and money-weighted (XIRR) methods, handling cash flows, and examples.
You can do everything right in a spreadsheet and still get a return figure that doesn't match your brokerage app. A mid-month deposit, a withdrawal before a rally, or a portfolio that mixes stocks, crypto, and cash can change the number enough to make the mismatch feel like an error, even when the arithmetic is fine. The underlying issue is usually simpler and more important, the platform and the spreadsheet may be answering different questions.
A portfolio return can look like a single clean percentage on paper, then break apart the moment you compare it with your broker statement, your spreadsheet, and the cash that moved in and out of the account. That is normal. The number changes with the method, the timing of deposits and withdrawals, and how complete the data is behind the calculation.
A mid-month deposit is the classic example. If a position rises after fresh capital enters the account, one method will credit the investor for that cash timing, while another will try to strip the timing effect out and show the strategy's own performance. A partial withdrawal creates the same kind of mismatch in the opposite direction. So a disagreement between two return figures does not automatically mean one of them is wrong.
The first reconciliation problem is usually methodological. A broker platform may report a return that neutralizes external cash flows, while a manual spreadsheet may be measuring the investor's actual experience, including when cash was added or removed. Two numbers can both be correct and still answer different questions. The distinction between time-weighted return (TWR) and money-weighted return (MWR/XIRR) is the first issue to settle, not the last Finzer's explanation of portfolio return methods.
Practical rule: if the account had external cash flows, first ask whether the number is meant to measure the strategy or the investor's capital path.
TWR is built to isolate the investment process itself. MWR is built to reflect the investor's personal result, including the timing of deposits and withdrawals.
For a stock-picking account that receives irregular cash injections, a return number without context can be misleading. A deposit just before a rebound can lift the reported result. A withdrawal just before the same rebound can suppress it. The same issue shows up when a portfolio mixes stocks and crypto, because different asset paths and cash-flow timing can make one headline return look better or worse depending on the method used. That is why a clean formula alone is incomplete, because how to calculate portfolio returns depends on what the calculation is supposed to prove.
The most basic formula is simple return, also called holding-period return. It measures the gain or loss from a beginning value to an ending value over a period with no external cash movement. The logic is direct, ending value minus beginning value, divided by beginning value.
That formula works well for a static slice of performance. If a trader bought one position and never added capital or pulled any out, the result is easy to interpret. Once deposits, withdrawals, dividends, or fees enter the picture, the number stops being a pure snapshot and starts needing context.

Two averages get mixed up constantly. Arithmetic mean is the average of period-by-period returns. Geometric mean is the compounded growth rate across those periods. That difference matters because returns build on prior gains or losses, and compounding is what an investor experiences over time.
A short sequence of gains and losses can produce the same arithmetic average as another sequence, while the compounded outcome ends up different. That is why performance measurement leans toward geometric linking when the question is cumulative growth, not just a rough historical average. In practical terms, arithmetic mean is a descriptive statistic, while geometric mean is a growth statistic.
The return formula can be correct and still be the wrong answer if it ignores compounding.
The geometric concept is the bridge to TWR, because TWR links sub-period returns multiplicatively. That makes it a better fit when the goal is to isolate investment performance across time. A trader who understands that distinction will have a much easier time reconciling a spreadsheet with a platform report, because the method itself becomes part of the explanation.
For people maintaining a live tracker, a structured system such as the one described in Alpha Scala's investment portfolio tracker guide helps keep the data organized before the return math even starts. Clean inputs matter more than clever formulas when the account includes more than one asset class.

A portfolio can show the same ending balance and still tell two very different performance stories. One version isolates what the holdings did. The other includes the effect of when cash entered or left the account.
Time-weighted return breaks the portfolio into sub-periods and links those returns geometrically. Its purpose is to remove the effect of deposits and withdrawals so the result reflects the performance of the holdings themselves. That is why professional managers use it to compare one strategy with another or to compare a strategy with a benchmark.
TWR is the right choice when the question is, “How well did the portfolio perform as an investment process?” It works well for a manager, a model portfolio, or a stock-selection method that needs to be judged against a market benchmark. If cash entered the account right before a rally, TWR keeps that timing from inflating the strategy score.
Money-weighted return reflects the timing and size of the investor's own cash flows. That makes it sensitive to when capital arrived and when it left. If money was added before gains, MWR includes that experience. If capital was added before losses, MWR also shows that pain.
That sensitivity is why MWR often feels more intuitive for personal accounts. It answers a different question, “What did this specific pile of money earn?” For a retail trader, that is often the number that matters most, because it captures the lived result of the account rather than an abstract strategy line.
| Criterion | Time-Weighted Return (TWR) | Money-Weighted Return (MWR/XIRR) |
|---|---|---|
| What it measures | Investment performance | Investor's actual gain |
| Cash flow treatment | Neutralizes deposits and withdrawals | Sensitive to cash flow timing |
| Best use | Manager evaluation and benchmarking | Personal portfolio return |
| Common confusion | Looks different from account growth | Looks different from strategy performance |
If rebalancing creates periodic buys and sells, the distinction becomes even more relevant. Keeping the portfolio structure clean before the return calculation begins helps avoid a lot of reconciliation noise, especially in accounts that mix stocks, cash, and crypto.
The return discrepancy many investors see is often not a math mistake. It is a methodology mismatch. One report may be trying to isolate underlying performance, while another is measuring the investor's cash path. The numbers can diverge sharply after a large deposit or withdrawal, especially if the market moved soon after.
Incomplete data makes the problem worse. Missing transaction timestamps, unreconciled transfers, or reinvested dividends recorded in the wrong place can make a correct formula produce a misleading answer. That is why performance measurement is not just about choosing TWR or MWR, it is also about making sure the account history is complete enough for the method you want to use.
For decision-making, the rule is simple. Use TWR to judge the strategy. Use MWR to judge the account owner's outcome. Trying to force both jobs into one number usually creates bad interpretation, not better insight.
A real portfolio example makes the gap between TWR and MWR easier to see. A portfolio can begin with one balance, receive a mid-period contribution, and end at a different value, yet those three numbers still do not tell you which return method you need. A single blunt formula usually gives the wrong answer if the goal is to understand both strategy performance and the investor's cash path.
For a money-weighted result, every cash flow needs a date and a sign. Contributions are cash outflows from the investor's perspective, while withdrawals and the ending value are inflows. In Excel or Google Sheets, XIRR is the practical shortcut because it uses actual dates instead of assuming evenly spaced periods.
A clean sheet usually has these columns:
Consistency matters more than the layout itself. Every external movement has to appear once, and only once. If a dividend is reinvested, it should follow the same cash-flow logic used elsewhere in the sheet instead of being guessed into the ending balance. That keeps the return calculation tied to the investor's actual capital path.
TWR needs a different structure. The portfolio is split into segments that end immediately before each external flow, and each sub-period gets its own return. Those returns are then chain-linked into one performance figure.
A simple sheet structure looks like this:
The process is mechanical, but it is unforgiving. If a deposit stays inside a sub-period instead of splitting the segment, the TWR will no longer stay neutral to cash flow timing.
For larger datasets, Python reduces manual error. A Pandas workflow can keep transactions in one table and valuation checkpoints in another, then calculate sub-period returns and chain them. That helps when the portfolio includes multiple assets, irregular contributions, or repeated rebalancing events.
import pandas as pd
transactions = pd.DataFrame([
{"date": "2024-01-01", "cash_flow": -10000},
{"date": "2024-02-15", "cash_flow": -2000},
{"date": "2024-03-31", "cash_flow": 12800},
])
transactions["date"] = pd.to_datetime(transactions["date"])
mwr = transactions.set_index("date")["cash_flow"].sort_index()
A lightweight script can also sit beside a portfolio dashboard, which is why many traders keep a live tracker open while they test ideas. A setup like Alpha Scala's portfolio tracking resources can support the calculation layer by keeping the data pipeline clean before the math runs.
The spreadsheet is for traceability. The script is for repeatability.
Python's main advantage here is consistency. Once the transaction rules are encoded, the same method can be applied to a stock-only account, a crypto-heavy account, or a blended portfolio without rewriting the formula each time.

A portfolio can look straightforward on paper and still be hard to measure in practice. Fees hit at different times, dividends land unevenly, foreign assets move with exchange rates, and some positions do not price cleanly every day. If those pieces are not handled explicitly, the return figure can look tidy while still giving the wrong answer.
Transaction costs reduce the investor's net result, so they belong in the return calculation. Dividends and interest also affect portfolio economics, but they need a consistent treatment, either as cash flows or as additions to value, depending on the framework you use. Taxes deserve the same discipline, because they change what the investor retains.
Performance measurement also has to stay aligned with portfolio construction. A practical rebalancing process, such as Alpha Scala's rebalancing guide, helps keep weights and trade timing clear before you decide how to treat the resulting return.
Foreign assets add another layer. A stock priced in one currency and held in a base-currency account creates return variation from the asset move and the exchange-rate move. The calculation has to be explicit about which currency is being measured.
If the portfolio spans U.S. stocks, European ETFs, and crypto, avoid mixing native-currency returns with base-currency returns in the same line item. Convert at the valuation date used for the portfolio report, then keep the currency choice consistent throughout the calculation. Otherwise, the number answers a different question than the one the trader asked.
Morningstar's methodology gives a useful example of how professional performance reporting handles incomplete data. When less than 75% of portfolio weight has usable returns for a month, the figures are footnoted, and the available-return weights are scaled to total 100% Morningstar methodology on incomplete monthly returns. That tells you something important. A return number is only as reliable as the way missing pieces are disclosed and normalized.
If the data trail is weak, the precision of the percentage is fake precision.
Illiquid assets, delisted securities, stale pricing, and uneven reporting schedules create this problem quickly. A clean formula can still produce a biased result if missing holdings are excluded without explanation. A careful analyst documents what was excluded, how weights were renormalized, and whether the portfolio included incomplete price coverage before trusting the outcome.
Altymo's Black Litterman insights also help frame the same issue from a different angle, because return measurement sits on top of assumptions about weights, inputs, and how much confidence to place in each source of data.
A portfolio return only matters if it survives a sanity check against the account records. The final step is not more calculation, it is checking the source data, the reporting method, and the assumptions used by the platform or spreadsheet. If the broker statement and your model disagree, the first job is to find the rule mismatch, not to keep adjusting the formula.
Brokerage statements often label performance in ways that hide the mechanics underneath. Some reports are built to remove the effect of cash flows, while others reflect the investor's actual experience after deposits and withdrawals. That is why the first audit question is simple, is this TWR or MWR? A correct answer to the wrong question still produces a figure that looks wrong.
Risk context also matters when a return looks strong on its own. A separate review of volatility and drawdown behaviour, such as Alpha Scala's Sharpe ratio guide, helps show whether a return came with a sensible amount of risk or just a noisy path.
The mistakes that distort portfolio performance are usually practical, not mathematical.
A mid-month deposit is a good test case. If you treat that cash flow like market gain, the return will be distorted even if every price is correct.
The safest workflow is to line up transaction history, valuation dates, cash flows, and the chosen return method before checking the final figure. If the account includes missing pricing, partial holdings, or stale quotes, the data assumptions should be written down beside the result. That habit turns performance measurement into a repeatable process instead of a one-off spreadsheet exercise.
Incomplete data deserves the same discipline. If a position has no usable return for a period, analysts should note the gap, explain the treatment, and avoid pretending the output is more precise than the inputs allow.
The best check is simple, but not simplistic. If the return number can be traced from source data to method to final output, the investor can trust it enough to act on it. If it cannot, the percentage is just decoration.
A repeatable process is the foundation of reliable performance tracking. For tools that help build that process, use Alpha Scala's Sharpe ratio guide as a practical reference point for comparing return with risk.
Published by AlphaScala under our editorial standards. Educational content only, not personalized financial advice.