Formula Reference: Yahoo Finance

  • All Yahoo Finance formulas start with EPF.Yahoo so they can be easily referenced.
  • Formulas can either be entered manually or via the shortcut buttons on the Configuration Pane.

Yahoo Finance provides data from many different exchanges, some are real-time (such as the NYSE and NASDAQ) whilst others are delayed. For full details of coverage refer to Exchanges and data providers on Yahoo Finance on the Yahoo Finance website.

Formula Description
EPF.Yahoo.Price Current mid price.
EPF.Yahoo.DayChange Change in price today.
EPF.Yahoo.DayChangePercent Percentage change in price today.
EPF.Yahoo.DayVolume Volume of shares traded today.
EPF.Yahoo.MarketCap Current market capitalisation.
EPF.Yahoo.52WeekHigh 52 week high.
EPF.Yahoo.52WeekLow 52 week low.
EPF.Yahoo.PERatio PE Ratio TTM (Trailing Twelve Months)
EPF.Yahoo.EPS EPS TTM (Trailing Twelve Months)
EPF.Yahoo.Currency Currency code.
EPF.Yahoo.DayHigh Day high.
EPF.Yahoo.DayLow Day low.
EPF.Yahoo.MarketOpen Market open price.
EPF.Yahoo.PrevClose Previous market close price.
EPF.Yahoo.Name Company name.
EPF.Yahoo.QuoteType Quote type, for example "EQUITY" or "MUTUALFUND".

Examples

Formula Description
=EPF.Yahoo.Price("AAPL") Populate the Excel cell with the current stock price of Apple.
=EPF.Yahoo.Volume("MSFT") Populate the Excel cell with the current daily volume of Microsoft.
=EPF.Yahoo.52WeekHigh("VFIAX") Populate the Excel cell with the 52 week high price of the Vanguard 500 Index Mutual Fund.


VBA Functions

All of the Yahoo Finance data which is available via Excel Formulas can also be accessed in VBA via a set of VBA functions. They all begin with EPF.Yahoo.VBA and can be used for market analysis, automated trading etc.

All Excel Price Feed VBA functions can be used from VBA by using the Application.Run function.

The list below is all the functions that can be called from VBA, see above for descriptions.

EPF.Yahoo.VBA.Price
EPF.Yahoo.VBA.DayChange
EPF.Yahoo.VBA.DayChangePercent
EPF.Yahoo.VBA.DayVolume
EPF.Yahoo.VBA.MarketCap
EPF.Yahoo.VBA.52WeekHigh
EPF.Yahoo.VBA.52WeekLow
EPF.Yahoo.VBA.PERatio
EPF.Yahoo.VBA.EPS
EPF.Yahoo.VBA.Currency
EPF.Yahoo.VBA.DayHigh
EPF.Yahoo.VBA.DayLow
EPF.Yahoo.VBA.MarketOpen
EPF.Yahoo.VBA.PrevClose
EPF.Yahoo.VBA.Name
EPF.Yahoo.VBA.QuoteType


VBA Yahoo Finance Examples

1. Return the live price of Microsoft stock:

Dim price As Variant
price = Application.Run("EPF.Yahoo.VBA.Price", "MSFT")


2. Return the day high price of Apple stock:

Dim bidPrice As Variant
bidPrice = Application.Run("EPF.Yahoo.VBA.DayHigh", "AAPL")


3. Sample Code for Apple stock quote and 52 week high in Excel VBA:

Yahoo Finance VBA Apple (AAPL) stock quote