The Scenario
You are a retail investor running your own portfolio. Rebalancing day is Sunday. You have 25 stocks in a Google Sheet, column A is the tickers, and before you make any moves you want each stock's 1-year return, 3-year annualized return, and 52-week high and low sitting next to the ticker so you can see everything in one place.
The slow version of Saturday afternoon:
- You open a finance site, look up stock one, write down the 52-week high and low
- You download a historical price CSV, open it, find the right dates, calculate the 1-year return by hand
- You realize you need a three-year date range and re-download
- You do it again for stocks two through twenty-five
- You give up at stock eleven and make a guess on the rest.
The fast version is one prompt.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent inside your spreadsheet that fetches the price history and runs the return calculations so you do not have to touch a CSV.
Try this yourself — free for 7 days
SheetXAI installs in your Google Sheet in about a minute. Paste the prompt below and watch it run.
Open the SheetXAI sidebar and type:
For each ticker in column A, fetch 3 years of weekly adjusted closing prices from Alpha Vantage and compute 1-year and 3-year annualized returns in columns B and C. Then pull the 52-week high and low for each ticker from Alpha Vantage daily data and write them into columns D and E alongside the current price in column F.
SheetXAI fetches the price history, calculates the returns using the appropriate date ranges, pulls the 52-week range, and writes everything into the sheet across all 25 tickers.
What You Get
A complete reference table across six columns for every ticker in your watchlist:
- Column B — 1-year return (as a percentage)
- Column C — 3-year annualized return
- Column D — 52-week high
- Column E — 52-week low
- Column F — current price
The returns are based on adjusted closing prices, which account for splits and dividends. This is the number that actually reflects your return, not the raw price change.
Want to add a momentum flag? Extend the prompt: "Also add a column G that marks 'Momentum' for any stock where the current price is within 10% of the 52-week high." SheetXAI adds it in the same run.
What If the Data Is Not Quite Ready
Watchlists are never perfectly maintained. SheetXAI handles edge cases and the fetch together.
When some tickers are recently IPO'd and lack 3-year history
A few tickers in your list went public less than three years ago. The three-year return calculation will fail or distort for those.
For each ticker in column A, fetch weekly adjusted closing prices from Alpha Vantage. If fewer than 3 years of data are available, calculate returns only for the period available and write "Partial History" in a notes column H. Write 1-year and annualized returns into columns B and C for all tickers.
When you want to flag positions that are near their 52-week low
You want a "watch" flag on any stock trading within 10% of its 52-week low, separate from the return columns.
After writing the 52-week high and low into columns D and E, compare column F (current price) to column E. If current price is within 10% of the 52-week low, write "NEAR LOW" in column G. Otherwise leave column G blank.
When you only want to update tickers that have changed since last week
You ran this last Saturday and do not want to re-fetch data for tickers where the numbers are unlikely to have moved.
Check column B for tickers that already have a 1-year return value. Only fetch new price data from Alpha Vantage for tickers where column B is blank. Leave existing values in place.
When you need the full picture before a portfolio review meeting
You have the tickers and nothing else. You want returns, the 52-week range, a momentum flag, and a dividend yield column, all before the Monday morning review.
For each ticker in column A, fetch 3 years of weekly adjusted prices from Alpha Vantage and calculate 1-year and 3-year annualized returns into columns B and C. Pull the 52-week high and low into columns D and E and current price into column F. Fetch the dividend yield from the Alpha Vantage company overview and write it into column G. In column H, flag any ticker where current price is within 10% of the 52-week high and dividend yield is above 2% as "Income + Momentum."
The pattern: one prompt handles the data fetch, the calculation, the conditional logic, and the flag. You do not need to do any of the steps separately.
Try It
Get the 7-day free trial of SheetXAI and open any watchlist sheet, then ask it to pull Alpha Vantage price history and compute returns for every ticker. The Alpha Vantage integration is included in every SheetXAI plan. For related workflows, see how to run a technical indicator screen or the Alpha Vantage in Google Sheets overview.
