Back to Alpha Vantage in Excel
SheetXAI logo
Alpha Vantage logo
Alpha Vantage · Excel Guide

Build a Price History and Returns Table in an Excel Workbook with Alpha Vantage

The Scenario

You are a retail investor running your own portfolio. Rebalancing day is Sunday. You have 25 stocks in an Excel workbook on the Watchlist tab 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 repeat for stocks two through twenty-five
  • You give up at stock eleven and make guesses on the rest.

The fast version is one prompt.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your workbook 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 Excel workbook in about a minute. Paste the prompt below and watch it run.

Open the SheetXAI sidebar and type:

Type this prompt

For each ticker in column A of the Watchlist tab, 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 workbook across all 25 tickers.

What You Get

A complete reference table across six columns for every ticker in the Watchlist tab:

  • 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, accounting for splits and dividends. This is the number that actually reflects your return, not the raw price change.

Want a momentum flag? Add "also add a column G that marks 'Momentum' for any stock where the current price is within 10% of the 52-week high" to the prompt.

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 went public less than three years ago. The three-year annualized return calculation will fail or distort for those.

Type this prompt

For each ticker in column A of the Watchlist tab, 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 column H. Write 1-year and annualized returns into columns B and C for all tickers.

When you want to flag positions near their 52-week low

You want a "watch" flag on any stock trading within 10% of its 52-week low.

Type this prompt

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 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.

Type this prompt

Check column B of the Watchlist tab 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 Monday morning portfolio review

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.

Type this prompt

For each ticker in column A of the Watchlist tab, 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 together.

Try It

Get the 7-day free trial of SheetXAI and open any watchlist workbook, 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 in Excel or the Alpha Vantage in Excel overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more