Previous Close Formula in Excel

Are you looking to quickly retrieve the most recent closing price for a stock, ETF, index, or other security in Excel? The Previous Close formula in Excel with MarketXLS makes it fast and straightforward to incorporate recent market data right into your spreadsheets. Read on to learn how to use this function effectively.

Understanding Previous Close

  • Purpose: The Previous Close formula returns the closing price of a security on its most recent trading day.
  • Key Benefits:
    • Enables quick access to up-to-date market data directly in Excel.
    • Helps you track portfolio performance without switching between multiple applications.
    • Integrates with a wide range of asset classes, including stocks, indices, options, and crypto.
  • When to Use:
    • Ideal for real-time data monitoring in financial models.
    • Useful for daily portfolio valuation and market analysis.

Syntax and Parameters

Below is the general syntax for the PreviousClose function:

=PreviousClose(Symbol)
Parameter Description Required Example
Symbol The ticker or identifier of the security to retrieve Yes "MSFT", "^SPX", or "BTCUSD:DEFAULT"

Return Value

  • Type: Numeric/string
  • Description: Returns the previous trading day’s closing price as a number. If the function encounters an invalid symbol, license issue, or any other error, it returns "NA".

Error Handling

  • If Symbol is invalid, the function will return "NA".
  • If the license is not valid, the function will return a license-related message or "NA".
  • A network or data retrieval error will also yield "NA".

Special Cases and Limitations

  • For certain non-equity asset classes (e.g., bonds or unsupported instruments), the function may return an error message prompting the use of a QuoteMedia function.
  • Data might be delayed by up to 15 minutes, depending on your data provider or MarketXLS subscription plan.

Performance Considerations

  • Queries are often cached for better performance, reducing repetitive data requests.
  • The function’s execution speed may depend on your internet connection and the MarketXLS data feed response time.

Examples and Usage

Below are some typical ways to use the Previous Close formula in Excel:

  1. Retrieve the previous close of a stock (e.g., Microsoft):
    =PreviousClose("MSFT")
  2. Fetch the previous close for an index (e.g., S&P 500):
    =PreviousClose("^SPX")
  3. Get the previous close of an option (e.g., MSFT 110122C00020000):
    =PreviousClose("@MSFT 110122C00020000")
  4. Display the previous close for a cryptocurrency (e.g., Bitcoin):
    =PreviousClose("BTCUSD:DEFAULT")

? Pro Tip: Combine the PreviousClose function with other MarketXLS formulas such as AskPrice or LastPrice to create comprehensive dashboards and gain immediate insights into market conditions.

Common Questions

  1. Why am I getting “NA” when I use the PreviousClose function?

    • Check for typos in the Symbol. Ensure your MarketXLS license is valid. If the asset type isn’t supported, consider a QuoteMedia function.
  2. Can I refresh the data automatically?

    • Yes. Use Excel’s refresh features or MarketXLS’s built-in refresh options to pull the latest data.
  3. How do I use PreviousClose in a larger financial model?

    • Simply reference the cell containing the PreviousClose formula in your calculations. This allows all dependent formulas and charts to update automatically.
  4. Is real-time data available?

    • The PreviousClose function specifically returns the last closing price. For real-time or streaming data, consider using MarketXLS’s real-time functions or QuoteMedia data feeds.

?? Note: Always confirm your subscription level and data entitlements with MarketXLS for full compatibility and access to all supported functions.


Use Previous Close to monitor assets effectively in your Excel dashboards. By integrating market data directly, you gain better visibility and confidence in your investment decisions.