Pull Historical Stock Prices

What You Will Learn

You will learn how to use GOOGLEFINANCE to pull historical stock prices, create a price series, and calculate returns over selected periods.

Required Dataset

No dataset is required.

Create three tabs:

Historical_Prices

Return_Analysis

Historical_Price_Check

Before You Start

Use exchange-qualified tickers where possible, such as NASDAQ:MSFT. Google’s GOOGLEFINANCE syntax is GOOGLEFINANCE(ticker, [attribute], [start_date], [end_date|num_days], [interval]), and Google recommends using both exchange and ticker symbols for accuracy. Historical attributes include fields such as open, close, high, low, volume, and all.

Step-by-Step Instructions

Step 1. Pull a historical close-price series

In Historical_Prices, enter:

=GOOGLEFINANCE(“NASDAQ:MSFT”,”close”,DATE(2026,1,1),DATE(2026,3,31),”DAILY”)

This should return a spilled table with dates and closing prices.

Step 2. Create a clean working table

Copy or reference the returned dates and close prices into a clean area with these fields:

Date

Close Price

Daily Return

Cumulative Return

For daily return, use:

=IFERROR(B3/B2-1,””)

For cumulative return, use:

=IFERROR(B2/$B$2-1,””)

Format both return fields as percentages.

Step 3. Calculate selected-period return

In Return_Analysis, create inputs for ticker, start date, and end date.

Use INDEX to pull a single historical close price:

=INDEX(GOOGLEFINANCE(“NASDAQ:MSFT”,”close”,DATE(2026,1,1)),2,2)

Then calculate period return:

=IFERROR(End Price/Start Price-1,””)

Step 4. Ask Gemini to review the formulas

Use this prompt:

Act as a Google Sheets market data formula reviewer. Explain the historical GOOGLEFINANCE formulas, daily return formula, cumulative return formula, and period return formula. Identify date, ticker, and missing-data risks.

Expected Result

You should have a historical price series, daily returns, cumulative returns, and a selected-period return calculation.

Check Your Work

Confirm that ticker format is correct, the price series returns data, returns are formatted as percentages, and start or end dates that fall on non-trading days are reviewed.

Optional Extension

Ask Gemini:

Create a cumulative return chart from Historical_Prices and explain why it is useful for comparing stock performance over time.

How to get started

1

arrow-down-blue

Tell us about your project

2

arrow-down-blue

Interview candidates

(We’ll provide bios within 48 hours on average)

3

Select your consultant and start work

Find a Consultant

or email us at: [email protected]