Historical Market Data in Excel & Google Sheets
You don't need Python to analyse market history — a spreadsheet handles charts, returns and moving averages just fine. This guide walks through getting clean historical price data into Excel or Google Sheets and doing something useful with it.

Step 1 — Download the CSV
Grab the instrument you want as a CSV — for example EUR/USD, gold or the US 500 index — choosing a timeframe that suits a spreadsheet. Daily or hourly candles are the sweet spot: Excel tops out at 1,048,576 rows, so decades of daily data fit easily, a few years of 1-minute data still fit, but tick data belongs in code, not a spreadsheet. The file layout (timestamp, open, high, low, close, volume) is documented in the CSV format guide.
Step 2 — Import into Excel
Don't just double-click the file — use Data → Get Data → From Text/CSV. Excel previews the file and detects the comma delimiter; click Load and you get a sortable, filterable table. The timestamp column arrives as a 13-digit number, because the export stores time as epoch milliseconds (milliseconds since 1 January 1970, UTC) rather than as a date string. Turn it into a date with one helper column:
=A2/86400000+DATE(1970,1,1)
Fill it down and format the column as yyyy-mm-dd hh:mm (Format Cells → Custom). 86,400,000 is the number of milliseconds in a day, and Excel counts dates in days, so the formula is exact.
Step 2 (alternative) — Import into Google Sheets
Use File → Import → Upload and keep "Detect automatically" for the separator. The same formula, =A2/86400000+DATE(1970,1,1), converts the timestamp; set the column to Format → Number → Date time. Sheets handles a few hundred thousand rows comfortably (the hard limit is 10 million cells across the sheet), so daily and hourly files are no problem.
Step 3 — Mind the timezone
The converted dates are UTC. For daily candles that rarely matters; for intraday analysis around session opens or news events, remember your local market hours are shifted — add the offset in the same helper column (e.g. =A2/86400000+DATE(1970,1,1)+TIME(2,0,0) for UTC+2) rather than editing the raw data, and remember that a fixed offset is only right until the next daylight-saving change.
Step 4 — Do something with it
- Daily returns:
=(E3-E2)/E2down the close column. - Moving average:
=AVERAGE(E2:E21)for a 20-period SMA, filled down. - Chart: select timestamp + close and insert a line chart — or use Excel's built-in stock chart type with the full open/high/low/close columns for candlesticks.
- Volatility:
=STDEV.S(range of returns)*SQRT(252)annualises daily return volatility.
Common pitfalls
- Saving the CSV back from Excel — Excel shows long integers in scientific notation, and re-saving as CSV can write that rounded display (
1.70415E+12) over the real timestamps, collapsing thousands of rows onto one instant. Keep the downloaded file untouched and save your work as .xlsx. - Too much data — if the file makes the spreadsheet crawl, re-download a shorter range or a coarser timeframe instead of fighting it.
- Weekend gaps — markets close; missing weekend rows are correct, not missing data (see the methodology).
Ready to try it? Pick any of the 265+ instruments and export a daily CSV — it opens straight into either tool.
Frequently asked questions
- How do I get historical stock or forex prices into Excel?
- Download the instrument as a CSV, then use Data → Get Data → From Text/CSV in Excel. The OHLC price columns are ready for charts and formulas; the timestamp column is epoch milliseconds, which =A2/86400000+DATE(1970,1,1) turns into a UTC date-time.
- How much historical data can Excel or Google Sheets handle?
- Excel holds up to 1,048,576 rows — decades of daily candles or a few years of 1-minute data. Google Sheets allows 10 million cells total. For tick data, use a shorter date range or a programming language instead.
- Why do my imported dates look wrong?
- The timestamp column is not a date string: it is the number of milliseconds since 1 January 1970 UTC, so it shows as a 13-digit number (or as 1.70415E+12 in a narrow column). Convert it with =A2/86400000+DATE(1970,1,1) and give the cell a date-time format. The result is in UTC.
- Can I build candlestick charts in a spreadsheet?
- Yes. Excel has a built-in stock (open-high-low-close) chart type, and Google Sheets offers a candlestick chart — both map directly onto the exported OHLC columns.
Related markets
- UK Stocks historical data · 12 instruments
- Japan Stocks historical data · 10 instruments
- Indices – Americas historical data · 6 instruments
- Indices – Europe historical data · 9 instruments
Related guides
- Backtesting a Trading Strategy with Historical Data
- Loading Historical Market Data in Python (pandas, Backtrader & VectorBT)
- Querying Historical Market Data with SQL (DuckDB)
- Automating Market Data Downloads
- How to Import Historical Data into MetaTrader 4 & 5
- Importing Historical Data into NinjaTrader 8
- How to Use MarketData Hub — The Complete Guide
- Download Gold (XAU/USD) Price History
- Historical Market Data CSV & JSON Format Explained
- Download EUR/USD Price History
- How Far Back Does Historical Market Data Go?