Calculator overview
Inputs and outputs
This summary comes from the calculator's published input and output contract.
Inputs
- Your holdings (required)
-
Default 12 rows
About this input
Your holdings, one per row: a name, the share of the portfolio it holds (its weight), its expected yearly return and its volatility (the standard deviation of its yearly returns). At least 2 and up to 12. Rows may be left empty anywhere, and each row you use needs all four values. The number in the # column is the holding's row and column number in the correlation table.
Column Range or allowed values # Not declared Holding Not declared Weight 0 to 1 Expected return -0.2 to 0.3 Volatility 0 to 1 - Risk-free rate (yearly) (required)
-
Unit % Default 0.04 Range 0 to 0.2
About this input
The yearly return of a holding with no risk, such as a short-term Treasury bill. The Sharpe ratio measures the portfolio's expected return above it.
- Correlation for pairs left blank (required)
-
Default 0.5 Range 0 to 1
About this input
The correlation used for every pair of holdings you leave blank in the correlation table, from 0 to 1. 0.5 is a cautious middle value: it counts on less diversification than many stock and bond pairs have shown, and on more than two stock funds usually give. Enter your own pairs where you know them.
- Correlations between your holdings (optional)
-
When omitted Blank
Default 12 rows
About this input
Optional. The correlation of each pair of holdings, from -1 (they move exactly opposite) to 1 (they move exactly together), with rows and columns numbered as the holdings. Enter a pair once, in either half of the table; if you enter both halves they must agree. A pair left blank uses the correlation for pairs left blank. The diagonal is always 1 and is not read, and cells in the row or column of an empty holdings row are not read.
Column Range or allowed values Holding Not declared With 1 -1 to 1 With 2 -1 to 1 With 3 -1 to 1 With 4 -1 to 1 With 5 -1 to 1 With 6 -1 to 1 With 7 -1 to 1 With 8 -1 to 1 With 9 -1 to 1 With 10 -1 to 1 With 11 -1 to 1 With 12 -1 to 1
Outputs
- Workbook self-check
-
No unit declared
About this output
PASS when the workbook's model consistency checks hold for this result: the weights, the shares of risk and the contributions to volatility add up, the variance agrees with a second calculation through the factorised correlations, and the curve passes through your portfolio. FAIL means the result should not be trusted; please report it.
- Second largest holding
-
No unit declared
About this output
The name of the holding with the second largest weight. The curve moves money between it and the largest holding.
- Money and risk by holding
-
No unit declared
About this output
One row per holding: its weight, expected return and volatility, its share of the portfolio's risk and its contribution to the portfolio's volatility. A share of risk is the holding's weight times its covariance with the whole portfolio, over the portfolio's variance. The shares add up to 100%, and a holding that tends to move against the rest has a negative share. The contributions add up to the portfolio's volatility.
- Weights as entered, added up
-
Unit %
About this output
The weights as you entered them, added up. When this is not 100%, each weight was divided by it before the results were worked out.
- Weighted average of the volatilities
-
Unit %
About this output
The weighted average of the holdings' volatilities: what the portfolio's volatility would be if every pair moved exactly together. The gap down to the portfolio's volatility is what diversification takes off.
- Sharpe ratio
-
No unit declared
About this output
The Sharpe ratio: the portfolio's expected return above the risk-free rate, divided by its volatility. Higher means more expected return for each unit of risk. It reads 0 when the portfolio has no volatility.
- Largest weight
-
Unit %
About this output
The weight of the largest holding, after the weights are scaled to add up to 100%.
- Largest holding
-
No unit declared
About this output
The name of the holding with the largest weight. On a tie, the first one in the table.
- Moving money between your two largest holdings
-
No unit declared
About this output
Thirty portfolios that keep every holding except the two largest at its weight and move the money of those two from all in the second largest to all in the largest, in equal steps. Each row gives the weights of the two, the expected return and the volatility. Your own portfolio lies on this curve. It is a what-if line, not an optimised frontier.
- Volatility of the portfolio (yearly)
-
Unit %
About this output
The volatility of the whole portfolio: the standard deviation of its yearly return, worked out from every holding's weight and volatility and the correlation of every pair. It is below the weighted average of the volatilities whenever the holdings do not all move exactly together.
- Expected return of the portfolio (yearly)
-
Unit %
About this output
The expected yearly return of the whole portfolio: each holding's expected return times its weight, added up. Weights that do not add up to 100% are first divided by their total.
- Model Status
-
No unit declared
About this output
Whether the inputs describe a portfolio the workbook can work out, any result to notice, or OK. The NOT VALID and CHECK reasons are listed in the methodology.
LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.
Methodology
Purpose and model boundary
This calculator works out the expected return and the risk of a portfolio of up to 12 holdings. For each holding you enter a name, its weight (its share of the money), its expected yearly return and its volatility (how much its yearly return typically swings). You can also say how closely each pair of holdings moves together. The main result is the expected return of the portfolio (yearly). Beside it are the portfolio's volatility, its Sharpe ratio, and the largest holding and its weight. Two tables show each holding's share of the risk and what happens as money moves between your two largest holdings. Two charts draw the same results.
Every figure on this page is computed by the spreadsheet; the page adds nothing to it. To bring a portfolio back to target weights, use the Asset Allocation Rebalancing Calculator; to see what fees take from a return over time, use the Investment Fees Drag Calculator.
The model is educational. It is not a forecast of any market, it is not an optimiser that picks the best portfolio, and it is not financial, investment, tax or legal advice.
Inputs and units
- Your holdings, a table of up to 12 rows. A row counts when it has all four values; an empty row anywhere is skipped. At least 2 holdings are needed.
- Holding: a name, used to label the tables and the charts.
- Weight: the holding's share of the money, from 0% to 100%.
- Expected return: the yearly return you expect from the holding, from -20% to 30%. Enter it after fees.
- Volatility: the typical yearly swing of the holding's return (its standard deviation), from 0% to 100%, in steps of 1%.
- Correlations between your holdings (optional), a 12 × 12 table whose rows and columns are the holdings' numbers in the first table. Each entry is from -1 to 1: 1 means the two always move together, 0 that they move independently and -1 that one rises when the other falls. A pair can be entered in either half of the table; if both halves are filled they must agree.
- Correlation for pairs left blank, from 0 to 1. Every pair you leave blank uses this value; 0.5 is shipped.
- Risk-free rate (yearly), from 0% to 20%, the return you could get without risk. The Sharpe ratio measures the expected return above it.
Weights, returns, volatilities and rates are percentages; correlations are plain numbers.
Governing relationships
Write wᵢ for the weight of holding i divided by the total of the weights, μᵢ for its expected return, σᵢ for its volatility and ρᵢⱼ for the correlation of holdings i and j (ρᵢᵢ = 1). Then:
- the covariance of two holdings is Σᵢⱼ = ρᵢⱼ × σᵢ × σⱼ;
- the expected return of the portfolio is μ = Σ wᵢ μᵢ;
- its variance is V = Σᵢ Σⱼ wᵢ wⱼ Σᵢⱼ, and its volatility is σ = √V;
- the Sharpe ratio is (μ − risk-free rate) ÷ σ;
- holding i's share of the risk is wᵢ × (Σⱼ Σᵢⱼ wⱼ) ÷ V. The shares add up to 100%, and a holding that tends to move against the rest can have a negative share;
- holding i's contribution to volatility is wᵢ × (Σⱼ Σᵢⱼ wⱼ) ÷ σ. The contributions add up to σ;
- the weighted average of the volatilities is Σ wᵢ σᵢ. The portfolio's volatility is never above it, and is below it whenever some pair is less than perfectly correlated.
The correlations used must be able to hold at once: no set of returns can have, for example, A and B and A and C almost perfectly correlated while B and C move almost perfectly opposite. The workbook tests this by factorising the table as L × Lᵀ (a Cholesky factorisation that allows zero pivots, so correlations of exactly 1 or -1 are accepted) and refusing the table when the factor does not reproduce it to within 0.0000001.
The curve moves money between your two largest holdings. Every other holding keeps its weight; the two largest share their combined weight, from all of it in the second largest to all of it in the largest, in 29 equal steps (30 points). For each point the expected return and volatility follow from the same formulas. Your portfolio is one point on that curve.
Calculation sequence
The spreadsheet first checks every input and counts the listed holdings. It divides each weight by their total, builds the correlations used (each pair from either half of the table, or the value for blank pairs), factorises them and checks the factor. It then works out each holding's risk terms, the portfolio's expected return, variance, volatility and Sharpe ratio, each holding's share of the risk and contribution to volatility, the two largest holdings and the 30 points of the curve. A block of consistency checks confirms the arithmetic before the status is returned.
Outputs and interpretation
The headline is the expected return of the portfolio (yearly). Beside it are the volatility of the portfolio (yearly), the Sharpe ratio, the largest weight and the largest holding. The first table lists each holding with its weight used, expected return, volatility, share of the risk and contribution to volatility; the second lists the 30 points of the curve. The second largest holding, the weighted average of the volatilities, the weights as entered added up and the workbook's self-check are returned to the API and MCP.
With the shipped example, Stocks at 60% expecting 7% with a volatility of 16%, Bonds at 40% expecting 4% with 6%, the correlation table blank so the pair takes 0.5, and a risk-free rate of 4%, the portfolio expects 5.80% a year with a volatility of 11.00% and a Sharpe ratio of 0.16. The weighted average of the volatilities is 12%, so holding the two together lowers the risk. Stocks are 60% of the money but carry 85.7% of the risk; Bonds carry 14.3%. Moving money between them runs from 4.00% expected at 6.00% volatility, all in Bonds, to 7.00% at 16.00%, all in Stocks.
With three funds, US stocks 50% (7%, 16%), international stocks 30% (7.5%, 18%) and bonds 20% (4%, 6%), US and international stocks correlated 0.85 and each with bonds 0.2, the portfolio expects 6.55% with a volatility of 13.21% and a Sharpe ratio of 0.19. The shares of risk are 58.8%, 38.5% and 2.7%: the bonds hold a fifth of the money but almost none of the risk.
The first chart sets each holding's share of the money (grey) against its share of the risk (blue). The second chart places each holding and the portfolio by volatility and expected return, with the curve dashed; the portfolio usually sits to the left of its holdings because they do not all move together.
Validation and status logic
The workbook evaluates the conditions below from top to bottom and returns the first matching status.
| Priority | Condition | Returned status |
|---|---|---|
| 1 | A listed holding is missing its name, weight, expected return or volatility | NOT VALID: give every holding you list a name, a weight, an expected return and a volatility |
| 2 | Fewer than 2 holdings are listed | NOT VALID: list at least 2 holdings |
| 3 | A weight is outside the supported interval | NOT VALID: each weight must be a number from 0% to 100% |
| 4 | An expected return is outside the supported interval | NOT VALID: each expected return must be a number from -20% to 30% a year |
| 5 | A volatility is outside the supported interval | NOT VALID: each volatility must be a number from 0% to 100% a year |
| 6 | The weights add up to 0% | NOT VALID: the weights add up to 0%; give at least one holding a weight above 0% |
| 7 | A correlation is outside the supported interval | NOT VALID: each correlation must be a number from -1 to 1 |
| 8 | A pair has two different correlations, one in each half of the table | NOT VALID: a pair of holdings has two different correlations, one in each half of the table; enter each pair once, or the same value in both places |
| 9 | The correlation for blank pairs is outside the supported interval | NOT VALID: the correlation for pairs left blank must be a number from 0 to 1 |
| 10 | The risk-free rate is outside the supported interval | NOT VALID: the risk-free rate must be a number from 0% to 20% a year |
| 11 | The correlations cannot all hold at once | NOT VALID: these correlations cannot all hold at once, because no set of returns could have them; change the pairs you entered, or leave more of them blank |
| 12 | The workbook's self-check fails | CHECK: the self-check of the workbook failed for this result, so do not rely on it; please report it |
| 13 | The weights do not add up to 100% (within 0.05 percentage points) | CHECK: the weights do not add up to 100%, so each one was divided by their total before the results were worked out |
| 14 | The portfolio has no volatility | CHECK: the portfolio has no volatility, so its Sharpe ratio and the shares of risk are not defined and read 0 |
| 15 | None of the preceding conditions applies | OK |
NOT VALID is a refusal, not a numeric answer: every number reads zero, every name is blank and the tables are empty. CHECK accompanies a computed result but calls for the stated review. The self-check is reported separately as arithmetic-integrity evidence; it does not replace this ordered status chain.
Assumptions and limitations
Each holding's expected return, volatility and correlations are assumptions you supply, held fixed for one year; the model does not estimate them from prices. Returns are treated through their means, volatilities and correlations only, so the model says nothing about how heavy the tails of the returns are. Weights must be from 0% to 100%: there is no borrowing, leverage or short selling. Fees, taxes and currency risk are not modelled, so enter returns after fees. The curve moves money only between the two largest holdings; it is not the efficient frontier of all your holdings and it does not search for the best portfolio. Amounts are nominal, with no allowance for inflation.
Restrictions and non-computing states
This calculator enforces its numeric limits, the 2 to 12 listed holdings and the agreement of the two halves of the correlation table before it accepts a result. A table of correlations that no set of returns could have is refused rather than adjusted.
Errors and warnings
A request rejected by the page's input limits is not a computed result. A transport or service failure cannot establish a fresh workbook answer. Review the workbook's References and Disclaimer, and check any plan with a qualified professional before using a result for a real decision.
References
Sources and further reading
Every weight, expected return, volatility, correlation and rate comes from the inputs, not market data. The workbook's References sheet lists the same five sources. They describe the methods the model follows; they do not endorse this calculator.
- H. Markowitz, "Portfolio Selection", The Journal of Finance 7(1), 1952: the mean and variance of a portfolio from its weights, expected returns and covariances, the basis of the portfolio's expected return and volatility here (retrieved 2026-10-18).
- W. F. Sharpe, "The Sharpe Ratio", The Journal of Portfolio Management 21(1), 1994: the expected return above a risk-free rate divided by the volatility (retrieved 2026-10-18).
- S. Maillard, T. Roncalli and J. Teïletche, "The Properties of Equally Weighted Risk Contribution Portfolios", The Journal of Portfolio Management 36(4), 2010: each holding's contribution to the portfolio's volatility, which together add up to that volatility (retrieved 2026-10-18).
- NIST/SEMATECH e-Handbook of Statistical Methods, section 6.5.4.1, "Mean Vector and Covariance Matrix": the covariance matrix of several variables, each entry a correlation times two standard deviations (retrieved 2026-10-18).
- G. H. Golub and C. F. Van Loan, Matrix Computations, 4th edition, Johns Hopkins University Press, 2013, section 4.2: the Cholesky factorisation of a symmetric positive semidefinite matrix, which the workbook uses to test whether the correlations can all hold at once (retrieved 2026-10-18).
The NIST section was read in full for this page. For the other four, the citation details (authors, title, journal or publisher, volume, year and identifier) were confirmed from their bibliographic records; their full texts were not read for this page, and each entry above describes only the method the calculator takes from it.
This is an educational estimate, not financial, investment, tax or legal advice. Expected returns, volatilities and correlations are assumptions about the future, not measurements of it; check any plan with a qualified professional.
Found a problem, or have an idea?
Tell us if a result looks wrong, a label is unclear, or something is missing. We read every message.