Google Sheets guide · November 1, 2026
Is Your Portfolio Beating Inflation? A Google Sheets Formula
A portfolio can grow in dollars while buying less. Put a CPI benchmark beside your investment return and check whether your purchasing power is above water or below it.
RuneDance Team · November 1, 2026 · 5 min read · Guides
“Am I above water?” is a useful second question after checking an investment gain. The first number describes growth in money; the second asks what that money can buy. A small Google Sheets dashboard can put both views together, without requiring a forecast about markets or prices.
Start with a public CPI series, calculate its twelve-month change, and compare it with a properly measured investment return. Here is a copyable formula and the few choices that make the comparison meaningful.
1. Pull a twelve-month inflation benchmark into Sheets
Paste this formula into B2, then format the cell as a percentage:
=LET(
data, IMPORTDATA("https://fred.stlouisfed.org/graph/fredgraph.csv?id=CPIAUCNS"),
dates, FILTER(INDEX(data,0,1), ISNUMBER(INDEX(data,0,2))),
cpi, FILTER(INDEX(data,0,2), ISNUMBER(INDEX(data,0,2))),
serial, ARRAYFORMULA(IFERROR(DATEVALUE(dates),dates)),
n, ROWS(cpi),
INDEX(cpi,n)/INDEX(cpi,MATCH(EDATE(INDEX(serial,n),-12),serial,0))-1
)IMPORTDATA reads the CSV. FILTER keeps numeric CPI observations and their dates, excluding the header and blank readings. The date conversion handles imported date strings while retaining dates already stored as numbers. LET names the intermediate results so the calculation remains readable.
The final line divides the latest index level by the level for the same month one year earlier, then subtracts one. EDATE chooses the comparison month; MATCH uses an exact date lookup. This assumes the observations arrive in ascending date order, as they did in the CSV checked for this article.
The CPIAUCNS series is an all-items, U.S. city-average consumer price index for urban consumers, monthly and not seasonally adjusted. The result is year-over-year inflation, not an index level, a forecast, or a reading of your personal household expenses.
2. Match the period before comparing the percentages
On November 1, 2026, the downloaded series ended in September 2026 at 336.940, versus 324.800 in September 2025. That produces 336.940/324.800-1 , approximately 3.74%. It is a September-to-September benchmark, even though you are opening the sheet in November. Future refreshes may return a different observation month.
Show that month beside the rate. To create a date cell, reuse the LET formula but replace its final calculation with INDEX(serial,n), then format the result as mmm yyyy. The first-of-month date labels an observation month; CPI is a monthly price measure, not a quote from that day.
Compare a USD investment return over the corresponding twelve-month window, rather than today’s year-to-date figure or a return since purchase. Matching month-end portfolio observations is a practical monthly approximation, not an exact daily match to a monthly price index. A portfolio measured in another currency needs a consistent currency and inflation benchmark.
3. Calculate real return: the buying-power result
Enter the investment return for that window in B3 as a percentage. In B4, use:
=(1+B3)/(1+B2)-1Format B4 as a percentage too. A hypothetical 6% investment return against the unrounded CPI change above produces roughly 2.18%real growth. The investment return is illustrative; the CPI inputs are the dated observations above. Subtracting inflation from the investment return is an approximation, while the ratio adjusts their growth factors directly.
For a status cell, put this in B5:
=IF(B4>0,"Above water",IF(B4<0,"Below water","Level"))Positive means ahead of this CPI benchmark; negative means behind it. That is a purchasing-power comparison, not a recommendation to trade. Include income and fees consistently in your investment return, and use an after-tax return if that is the question you want to answer. Your personal spending mix can differ from the average CPI basket.
4. Keep the portfolio inputs and the return calculation separate
InvestSheet can bring connected holdings into the same Google Sheet. For example:
=IVS_BROKERAGE("value")
=IVS_BROKERAGE("costBasis")
=IVS_BROKERAGE("gainLoss")These supply holding value, cost basis, and unrealized gains or losses. They do not produce a twelve-month total return. In particular, unrealized gain divided by cost basis is not automatically an annual performance figure.
Keep dated valuations and records of deposits, withdrawals, income, and realized activity. Added savings are not investment gains. When cash flows occur, use a return method that accounts for their timing; an annualized result from a different window is not directly comparable with the CPI rate in B2.
Start with our free manual holdings template if you want to organize inputs first. Add InvestSheet for supported brokerage syncing, and keep the return calculation, CPI month, and real-return cell clearly labeled. If a prior-year month is missing, leave the lookup error visible instead of substituting a nearby month or zero. If imports or date parsing fail, check the CSV and spreadsheet locale before interpreting the result.
Inflation formula questions
Does this formula show today’s inflation rate?
It returns the twelve-month change for the latest available monthly CPI observation. It is not a daily reading. Check the observation month before comparing it with an investment return, and keep a dated snapshot if you need a reproducible comparison.
Why does the CPI formula return an error?
Check whether IMPORTDATA can access the CSV, the values are numeric, and the dates parse correctly for your spreadsheet locale. MATCH needs the exact month twelve months earlier. Missing comparison data should remain visible as an error, not be replaced with zero inflation.
Does InvestSheet calculate my inflation-adjusted annual return?
No. InvestSheet supplies connected holding values, cost basis, and unrealized gains or losses. Calculate a properly measured investment return separately, align its period with your CPI comparison, and then use the real-return formula in Google Sheets.
Put holdings and purchasing power in the same sheet
Bring connected brokerage holdings into Google Sheets with InvestSheet, then build your own review around value, cost basis, and unrealized gains or losses. Add the CPI benchmark and your separately calculated investment return beside them.
Install InvestSheetNot investment advice. This article is for general informational purposes only and does not constitute investment advice, a recommendation, or a solicitation to buy or sell any security. It is not personalized to your financial situation. Past performance and market moves described here do not predict future results. The specific holdings, prices, and formulas shown are illustrative examples for demonstrating a workflow, not a suggestion that you should make those trades. Investing involves risk, including the possible loss of principal. Do your own research or consult a licensed financial advisor before making any investment decision. For our full terms, see the Disclaimer.