Home MarketXLS
Dashboard MarketXLS
Screener MarketXLS
Options Profit Calculator MarketXLS
Stock Ranks MarketXLS
Spreadsheet Builder MarketXLS
Documentation MarketXLS
Logout MarketXLS

Retrieve Last Trade Date and Time with QM_LastTradeDateTime

The QM_LastTradeDateTime function in MarketXLS allows you to quickly retrieve the last known trade date and time for a given stock symbol right inside your Excel spreadsheet. This function helps you stay current with market data and is especially helpful for tracking or analyzing securities in a time-sensitive manner.

Why Use This Function?

  • Keep track of real-time (or recently cached) last trade data for your stocks.
  • Avoid manual lookups on multiple platforms—MarketXLS fetches it for you directly.
  • Quickly integrate with other analytical, charting, or date-based calculations in Excel.
  • Saves time by automatically converting the trade date/time into a user-friendly format.
  • Great for portfolios, watch lists, or any time-sensitive stock analysis tasks.

How to Use in Excel

QM_LastTradeDateTime(symbol)
  1. Type the formula in any Excel cell.
  2. Replace symbol with a valid ticker symbol (e.g., "AAPL" for Apple).
  3. Press Enter, and MarketXLS will fetch the last trade date/time from the QuoteMedia data source.
  4. If the result appears as a number, select the cell and format it as Date/Time under Excel's cell formatting options.

Parameters Explained

Parameter Description Example Values Notes
symbol The stock ticker symbol you want to retrieve the data for. "AAPL", "MSFT" Must be a valid ticker symbol recognized by the data source.

• Only one parameter (symbol) is required.
• If the symbol is invalid or unsupported, the function may return "NA" or an unparsed string.

Example Usage

Basic Examples

  1. =QM_LastTradeDateTime("AAPL")

    • Returns the date and time of the last trade for Apple.
    • The result might show a full date/time such as "10/20/2023 15:59:00" (depending on formatting).
  2. =QM_LastTradeDateTime("MSFT")

    • Retrieves the last trade date/time for Microsoft.
    • Useful for quickly comparing trade timestamps with Apple, or other tickers.
  3. =QM_LastTradeDateTime(A2)

    • Cell A2 might contain "GOOGL."
    • Helps when referencing multiple symbols in a single column.

Advanced Scenarios

• Portfolio Updates:

  • Suppose you have a list of different US stocks you track daily. Enter symbols in a column (A2:A10), then in a parallel column use =QM_LastTradeDateTime(A2), =QM_LastTradeDateTime(A3), and so forth for a quick watchlist overview.

• Combined Calculations:

  • You could combine this function’s result with Excel’s date or time functions. For example, if you need to check how many days have passed since the last trade date, you could reference =TODAY() - QM_LastTradeDateTime("AAPL") in a date-formatted cell.

• Tracking Market Close:

  • Compare last trade times for multiple symbols to see how close to market close a trade occurred, potentially informing end-of-day decisions.

Common Questions and Troubleshooting

  1. Why do I get “NA” returned for some symbols?

    • The symbol might be invalid, or data isn’t available. Double-check the spelling and ensure the symbol is recognized by MarketXLS.
  2. I see "Please Refresh" or "Refreshing." What does that mean?

    • This indicates MarketXLS needs to pull fresh data. Depending on your subscription or setup, you might have to refresh the data manually via the MarketXLS ribbon or wait until the data updates.
  3. My cell shows a strange numeric value instead of a date.

    • Excel may have formatted the cell as a number. Right-click the cell ? Format Cells ? select a Date/Time format.
  4. Could I get an error instead of a date/time?

    • If there was an issue converting the date/time string, the function returns it as-is (e.g., “ERR” or blank). Check your symbol and refresh status.
  5. Do I need a special subscription?

    • Yes. MarketXLS relies on your active data subscription to fetch real-time/updated data. Ensure you have a valid license and data plan for this function to work correctly.

With QM_LastTradeDateTime, your Excel workbook can display up-to-date last trade timestamps for US stocks, improving your analysis and decision-making while reducing manual effort. This function integrates seamlessly in your Excel environment alongside other MarketXLS tools to make your investment tracking more efficient.