Excel Stock Functions: How to Get Real-Time Quotes, Historical Data, and Fundamentals in Excel (2026)

M
MarketXLS Team
Published
Excel stock functions dashboard showing real-time stock data using MarketXLS

Excel stock functions transform a plain spreadsheet into a live financial dashboard capable of tracking stock prices, analyzing fundamentals, and monitoring portfolio performance in real time. Whether you are a casual investor checking a few tickers or a professional trader building a multi-screen monitoring setup, Excel provides multiple methods to bring market data into your workbook. In this comprehensive 2026 guide, you will learn every available approach - from Microsoft's built-in STOCK data type and STOCKHISTORY function to Power Query connections and the professional-grade MarketXLS add-in with over 1,000 financial functions. By the end, you will know exactly which excel stock function to use for any market data task.

Excel Stock Functions: The Built-In STOCK Data Type

Microsoft introduced the Stocks linked data type in Excel 365 and Excel 2021. It is the simplest way to surface market data without any add-in or external connection.

How to Enable It

  1. Type a ticker symbol (e.g., AAPL) into a cell
  2. Select the cell and go to the Data tab
  3. Click Stocks in the Data Types group
  4. Excel converts the text into a rich, linked data type powered by Refinitiv

Once converted, click the small icon next to the cell to see available fields including Price, Previous Close, 52-Week High, 52-Week Low, Market Cap, P/E Ratio, Volume, and Beta.

Extracting Fields

After converting cell A2 to the Stocks data type, pull fields into adjacent cells:

=A2.Price
=A2.[52-week high]
=A2.[Market cap]
=A2.[P/E]
=A2.Beta
=A2.Volume

Combine with XLOOKUP

Build a reference table with converted Stocks data-type cells in column A and extracted prices in column B. Use =XLOOKUP("AAPL",A:A,B:B) anywhere in your workbook to retrieve Apple's price dynamically.

Limitations

  • Data refreshes only when you click Refresh All or reopen the workbook - not real-time
  • Requires Microsoft 365 subscription (not available in Excel 2019 or earlier)
  • Limited to equities and select indices - no options, futures, or crypto
  • No historical time-series - only a single snapshot per field
  • Field names vary by locale, which can break formulas in shared workbooks
  • Roughly 15 available fields - far fewer than professional data platforms

Excel Stock Functions: The STOCKHISTORY Function

STOCKHISTORY is the primary built-in excel stock function for pulling historical price data into a dynamic spill range.

Syntax

=STOCKHISTORY(stock, start_date, [end_date], [interval], [headers], [property0], [property1], ...)
ParameterDescriptionValues
stockTicker symbol"MSFT"
start_dateFirst dateDATE(2025,1,1)
end_dateLast date (default = today)TODAY()
interval0 = Daily, 1 = Weekly, 2 = Monthly0
headers0 = None, 1 = Show, 2 = Show with ticker1
property0 = Date, 1 = Close, 2 = Open, 3 = High, 4 = Low, 5 = VolumeMultiple

Example: Daily Closes for 2025

=STOCKHISTORY("AAPL", DATE(2025,1,2), DATE(2025,12,31), 0, 1, 0, 1)

Returns a two-column table with Date and Close for every trading day.

Example: Monthly OHLCV

=STOCKHISTORY("MSFT", DATE(2020,1,1), TODAY(), 2, 1, 0, 2, 3, 4, 1, 5)

Returns monthly Open, High, Low, Close, and Volume.

Common Errors

  • #VALUE! - Ticker not recognized. Double-check the symbol
  • #CALC! - Date range contains only non-trading days. Extend the range
  • #SPILL! - Cells below the formula contain data. Clear them
  • Empty results - International tickers may not be available through Refinitiv

Limitations

  • Only available in Microsoft 365
  • Data source is Refinitiv - no control over the provider
  • No intraday granularity
  • No fundamental data (P/E, revenue, dividends)
  • No options or derivatives data
  • Maximum date range may be limited for some tickers

Excel Stock Functions: Power Query for Stock Data

Power Query (Get & Transform) can connect to REST APIs, CSV feeds, or web pages to import stock data into Excel tables.

Steps

  1. Go to Data - Get Data - From Other Sources - From Web
  2. Enter the API endpoint URL (e.g., Alpha Vantage, Twelve Data)
  3. Power Query opens the navigator - select the data table
  4. Transform columns (change types, rename headers, filter dates)
  5. Click Close & Load to push data into a worksheet table

Advantages

  • Handles JSON, XML, CSV, and HTML tables
  • Supports scheduled background refresh
  • Excellent for bulk historical data imports

Disadvantages

  • Data lands in a table, not individual cells
  • Requires manual or scheduled refresh - not streaming
  • API authentication can be complex
  • Not practical for real-time dashboards

Excel Stock Functions: GOOGLEFINANCE Comparison

If you also work in Google Sheets, the GOOGLEFINANCE function provides a comparison point. GOOGLEFINANCE is free, supports about 18 attributes (price, volume, P/E, EPS, market cap), and includes basic historical daily/weekly data. However, it is locked to Google Sheets, has 20-minute data delays, no dividend data, no technical indicators, and no options support. For a detailed comparison, see our Google Finance Formulas guide.

Excel Stock Functions: MarketXLS - The Professional Add-In

MarketXLS is a professional add-in for Excel (and Google Sheets) that adds over 1,000 spreadsheet functions covering real-time quotes, historical prices, fundamentals, options chains, Greeks, technical indicators, and more. It transforms Excel into a complete financial analysis platform.

Real-Time Price Functions

FunctionWhat It ReturnsExample
=LAST("AAPL")Last trade priceReturns current price
=QM_LAST("AAPL")Last price via QuoteMediaReturns current price
=STREAM_LAST("AAPL")Streaming real-time priceAuto-updates as trades happen
=BID("AAPL")Current bid priceReturns bid
=ASK("AAPL")Current ask priceReturns ask
=PREVIOUSCLOSE("AAPL")Previous closeReturns yesterday's close
=CHANGE("AAPL")Price changeReturns change since close
=VOLUME("AAPL")Current volumeReturns today's volume

=LAST("AAPL") is the simplest excel stock function for getting a current price. Drop it in any cell and MarketXLS returns the most recent trade price. For streaming, auto-updating data, use =STREAM_LAST("AAPL") - prices push to your cell as trades execute without manual refresh.

Historical Data Functions

FunctionWhat It Returns
=QM_GETHISTORY("AAPL")Full OHLCV history table
=GETHISTORY("AAPL","2025-01-01","2025-12-31","D")Custom date range
=OPEN_HISTORICAL("AAPL","2025-06-01")Historical open price
=CLOSE_HISTORICAL("AAPL","2025-06-01")Historical close price
=HIGH_HISTORICAL("AAPL","2025-06-01")Historical high
=LOW_HISTORICAL("AAPL","2025-06-01")Historical low
=ADJUSTED_CLOSE_HISTORICAL("AAPL","2025-06-01")Split/dividend-adjusted close

=QM_GETHISTORY("AAPL") spills a complete daily OHLCV table into your sheet - one function call replaces manual CSV downloads.

Fundamental Data Functions

FunctionWhat It Returns
=PERATIO("AAPL")P/E ratio
=FORWARDPE("AAPL")Forward P/E
=TRAILINGPE("AAPL")Trailing P/E
=PEGRATIO("AAPL")PEG ratio
=PRICETOBOOK("AAPL")Price-to-book ratio
=MARKETCAPITALIZATION("AAPL")Market capitalization
=DIVIDENDYIELD("AAPL")Dividend yield
=DIVIDENDPERSHARE("AAPL")Dividend per share
=PAYOUTRATIO("AAPL")Payout ratio
=PROFITMARGIN("AAPL")Profit margin
=OPERATINGMARGIN("AAPL")Operating margin
=REVENUEGROWTH("AAPL")Revenue growth rate
=BETA("AAPL")Beta
=SECTOR("AAPL")Sector classification
=INDUSTRY("AAPL")Industry classification
=REVENUE("AAPL")Total revenue
=TOTALDEBT("AAPL")Total debt
=TOTALCASH("AAPL")Cash on hand
=BOOKVALUEPERSHARE("AAPL")Book value per share

Technical Indicator Functions

FunctionWhat It Returns
=RSI("AAPL")14-day Relative Strength Index
=SIMPLEMOVINGAVERAGE("AAPL",50)50-day SMA
=SIMPLEMOVINGAVERAGE("AAPL",200)200-day SMA
=EXPONENTIALMOVINGAVERAGE("AAPL",12)12-day EMA
=EXPONENTIALMOVINGAVERAGE("AAPL",26)26-day EMA
=FIFTYTWOWEEKHIGH("AAPL")52-week high
=FIFTYTWOWEEKLOW("AAPL")52-week low

Options Data Functions

Excel's built-in functions have zero options support. MarketXLS fills this gap completely:

=QM_GETOPTIONCHAIN("^SPX")                    // Full option chain
=OPTIONSYMBOL("AAPL","2026-06-19","C",200)     // Build option symbol
=QM_LAST("@AAPL 260619C00200000")              // Option contract price
=QM_GETOPTIONQUOTESANDGREEKS("^SPX")           // Full Greeks and IV
=IMPLIEDVOLATILITY("AAPL")                     // Current implied volatility

Historical Financial Statement Data

=HF_REVENUE("AAPL",2025)              // 2025 revenue
=HF_NET_INCOME("AAPL",2025)           // 2025 net income
=HF_FREE_CASH_FLOW("AAPL",2025)       // 2025 free cash flow
=HF_TOTAL_ASSETS("AAPL",2025)         // 2025 total assets

Excel Stock Functions: Head-to-Head Comparison

CapabilitySTOCK Data TypeSTOCKHISTORYPower QueryGOOGLEFINANCEMarketXLS
PlatformExcel 365Excel 365Excel (all)Google SheetsExcel + Sheets
CostIncludedIncludedIncludedFreeSubscription
Real-timeDelayed snapshotNoNo20-min delayReal-time + streaming
HistoricalNoDaily/Weekly/MonthlyVia APIDaily/WeeklyFull OHLCV
Fundamentals~15 fieldsNoVia API~10 fields1,000+ functions
OptionsNoNoNoNoFull chains + Greeks
TechnicalNoNoNoNoRSI, SMA, EMA
DividendsLimitedNoVia APINoFull coverage
StreamingNoNoNoNoYes

Excel Stock Functions: Building a Real-Time Dashboard

Here is a step-by-step guide to building a professional stock dashboard using excel stock functions:

Step 1: Set Up Your Ticker List

In column A, list your tickers: AAPL, MSFT, GOOGL, AMZN, NVDA, TSLA, META, JPM, V, UNH.

Step 2: Pull Real-Time Prices

In column B, use MarketXLS:

=LAST(A2)

Copy down for each ticker. For streaming, use =STREAM_LAST(A2) instead.

Step 3: Add Key Metrics

ColumnFormulaDescription
C=PREVIOUSCLOSE(A2)Previous close
D=CHANGE(A2)Daily change
E=VOLUME(A2)Trading volume
F=PERATIO(A2)P/E ratio
G=BETA(A2)Beta
H=RSI(A2)RSI (14-day)
I=SIMPLEMOVINGAVERAGE(A2,50)50-day SMA
J=DIVIDENDYIELD(A2)Dividend yield

Step 4: Add Conditional Formatting

  • Highlight RSI cells red when > 70 (overbought) and green when < 30 (oversold)
  • Highlight dividend yields above 3% in green
  • Highlight negative daily changes in red

Step 5: Create Charts

Select price and SMA columns to create a combo chart overlaying the moving average on daily prices. Add a volume bar chart below for context.

Step 6: Add a Historical Data Sheet

On a separate sheet, use =QM_GETHISTORY(A2) to spill full OHLCV history for any ticker. Reference this data in charts or analysis formulas on other sheets.

Step 7: Add an Options Monitor

On a third sheet:

=QM_GETOPTIONCHAIN("^SPX")

This pulls the full S&P 500 options chain with strikes, bids, asks, volume, open interest, and Greeks.

Automating Refresh

MarketXLS supports on-demand refresh via its ribbon. Set your workbook to refresh all data connections at a specified interval through Data - Connections - Properties. For =STREAM_LAST() functions, no manual refresh is needed - data pushes automatically.

Excel Stock Functions: Tips for Maximum Performance

  1. Use named ranges for ticker lists so formulas stay readable
  2. Combine STOCKHISTORY with XLOOKUP to pull a specific date's close from a spilled range
  3. Put =TODAY() in one cell and reference it everywhere to reduce recalculation overhead
  4. Cache historical data by pasting values once you have the range you need
  5. Use Excel Tables (Ctrl+T) so new tickers automatically inherit formulas
  6. Use =LAST() for snapshots and =STREAM_LAST() only for actively monitored tickers
  7. Explore MarketXLS templates - over 100 pre-built templates for portfolio tracking, options analysis, and screening

Excel Stock Functions: Download Templates

We have created ready-to-use templates demonstrating every excel stock function discussed in this guide:

  • - Contains sample data and formula references
  • - Contains live formulas (requires MarketXLS add-in)

Each workbook includes six sheets: How To Use, Main Dashboard, Scenario Analysis, Strategy, Portfolio Comparison, and Correlation Matrix.

Excel Stock Functions: Frequently Asked Questions

Is there a free stock function built into Excel?

Yes. If you have Microsoft 365, the Stocks data type and the STOCKHISTORY function are included at no extra cost. They provide delayed quotes and historical daily prices for most major equities. For real-time streaming, options data, dividends, or technical indicators, you will need an add-in like MarketXLS.

How do I get real-time stock prices in Excel?

The fastest method is to use the MarketXLS function =LAST("AAPL") for the latest trade price, or =STREAM_LAST("AAPL") for continuously streaming real-time prices. Excel's built-in Stocks data type provides only delayed snapshots that require manual refresh.

Can I pull options data into Excel?

Excel's built-in functions do not support options. MarketXLS fills this gap with =QM_GETOPTIONCHAIN("^SPX") for full option chains and =QM_GETOPTIONQUOTESANDGREEKS("^SPX") for Greeks, implied volatility, and bid/ask data. You can also build option symbols programmatically with =OPTIONSYMBOL().

Does STOCKHISTORY work in Excel 2019?

No. The STOCKHISTORY function requires Microsoft 365 (formerly Office 365). It is not available in perpetual-license versions like Excel 2019 or 2016. For those versions, MarketXLS or Power Query are the best alternatives for historical stock data.

What is the difference between =LAST() and =STREAM_LAST() in MarketXLS?

=LAST("AAPL") returns the most recent trade price when you refresh your workbook. It is a snapshot - the value stays static until the next refresh. =STREAM_LAST("AAPL") opens a streaming connection that continuously updates the cell as new trades execute. Use =LAST() for end-of-day analysis and =STREAM_LAST() for active intraday monitoring.

How many stocks can I track at once?

There is no hard limit with either built-in functions or MarketXLS. Performance depends on system resources and data plan. The built-in Stocks data type may slow down with hundreds of converted cells. MarketXLS is optimized for large watchlists. For best performance, reserve =STREAM_LAST() for actively monitored tickers and use =LAST() for the rest.

Excel Stock Functions: Summary

Excel stock functions have evolved significantly - from the basic Stocks data type to STOCKHISTORY, Power Query, and professional add-ins. For casual investors, the built-in tools in Microsoft 365 handle simple price lookups and historical charts. For professionals who need real-time streaming, deep fundamentals, options chains, technical indicators, and dividend analysis, MarketXLS transforms Excel into a complete financial analysis platform.

The best approach is to layer these tools: use STOCKHISTORY for quick historical pulls, Power Query for bulk imports, and MarketXLS functions like =LAST(), =PERATIO(), =RSI(), and =QM_GETHISTORY() for everything else. With the right combination of excel stock functions, your spreadsheet becomes the only financial dashboard you need.

Ready to explore professional excel stock functions? Visit MarketXLS to see available plans and unlock 1,000+ financial functions.

Important Disclaimer

The information provided in this article is for educational and informational purposes only and should not be construed as investment advice, a recommendation, or an offer to buy or sell any securities. MarketXLS is a financial data platform and is not a registered investment advisor, broker-dealer, or financial planner. Always conduct your own research and consult with a qualified financial professional before making any investment decisions. Past performance is not indicative of future results. Trading and investing involve substantial risk of loss.

Interested in building, analyzing and managing Portfolios in Excel?
Download our Free Portfolio Template
I agree to the MarketXLS Terms and Conditions
Call: 1-877-778-8358
Ankur Mohan MarketXLS
Welcome! I'm Ankur, the founder and CEO of MarketXLS. With more than ten years of experience, I have assisted over 2,500 customers in developing personalized investment research strategies and monitoring systems using Excel.

I invite you to book a demo with me or my team to save time, enhance your investment research, and streamline your workflows.
Implement "your own" investment strategies in Excel with thousands of MarketXLS functions and templates.
MarketXLS provides all the tools I need for in-depth stock analysis. It's user-friendly and constantly improving. A must-have for serious investors.

John D.

Financial Analyst

I have been using MarketXLS for the last 6+ years and they really enhanced the product every year and now in the journey of bringing in AI...

Kirubakaran K.

Investment Professional

MarketXLS is a powerful tool for financial modeling. It integrates seamlessly with Excel and provides real-time data.

David L.

Financial Analyst

I have used lots of stock and option information services. This is the only one which gives me what I need inside Excel.

Lloyd L.

Professional Trader

Meet The Ultimate Excel Solution for Investors

Live Streaming Prices in your Excel
All historical (intraday) data in your Excel
Real time option greeks and analytics in your Excel
Leading data service for Investment Managers, RIAs, Asset Managers
Easy to use with formulas and pre-made sheets