Retrieving Company Revenue in USD with MarketXLS

MarketXLS offers the hf_revenue_usd function to quickly retrieve a company's revenue in USD for a specific year, quarter, or even on a trailing twelve-month (TTM) basis. This function taps into MarketXLS’s historical fundamentals data, helping you make faster and more informed investment or financial analysis decisions directly in Excel.

Why Use This Function?

  • Access U.S. company revenue data without leaving Excel.
  • Analyze historical revenues for specific quarters or years.
  • Optionally retrieve TTM (trailing twelve-month) revenue for comprehensive trend analysis.
  • Integrate with other MarketXLS fundamental and technical functions to build dynamic dashboards.
  • Save time by centralizing your financial data gathering in Excel.

How to Use in Excel

=hf_revenue_usd(Symbol, Year, Quarter, [Optional TTM])
  1. Enter the function in any cell in Excel.
  2. Provide the stock Symbol (e.g., "AAPL", "MSFT").
  3. Specify the Year as a four-digit number or string (e.g., 2022).
  4. Specify the Quarter (1, 2, 3, or 4).
  5. Optionally, pass "TTM" to retrieve trailing twelve-month data for that period.
  6. Press Enter, and MarketXLS will fetch the requested revenue data in USD.

Make sure you have the appropriate MarketXLS subscription (Type4) for access to historical fundamentals data; otherwise, you may see a "NA" result.

Parameters Explained

Parameter Description Example Values Notes
Symbol The stock ticker or symbol of the company of interest. "AAPL", "MSFT" Must be a valid stock symbol. Invalid symbols may return "NA".
Year The specific year for which you want the revenue. "2022", "2021" Use four digits. If invalid or out of bounds, the result may fall back to "NA".
Quarter The numeric quarter (1, 2, 3, or 4). Defaults to "1" if omitted, but internally can reset. 1, 2, 3, or 4 If blank, code sets it to "2". If an incorrect quarter is passed, it may return "NA".
TTM (Optional) Pass "TTM" to request trailing twelve-month data. Leave blank for single period. "TTM", "" (blank) When TTM is used, the function calculates the last four quarters of data for a rolling 12-month figure.

Example Usage

Basic Examples

  1. Retrieve Apple’s revenue for the first quarter of 2022:
    =hf_revenue_usd("AAPL", 2022, 1)
    This returns AAPL’s Q1 2022 revenue in USD.

  2. Retrieve Microsoft’s revenue for the fourth quarter of 2021:
    =hf_revenue_usd("MSFT", "2021", 4)
    Using a string for the year also works. The function returns MSFT’s Q4 2021 revenue in USD.

  3. Retrieve Apple’s trailing twelve-month revenue for 2022 Q1:
    =hf_revenue_usd("AAPL", "2022", 1, "TTM")
    This instructs MarketXLS to fetch Apple’s aggregated revenue over the previous 12 months ending in Q1 2022.

Advanced Scenarios

• Referencing cells in Excel:
Suppose you have "AAPL" in cell A2, "2022" in cell B2, and "1" in cell C2. You can write:
=hf_revenue_usd(A2, B2, C2)
This approach is especially helpful if your model lists multiple symbols and dates.

• Combining with other MarketXLS functions:
You might integrate hf_revenue_usd with ratio functions like hf_pe, hf_dividends, or algebraic operations to build comparative fundamental dashboards.

• Automating TTM updates:
You can set "TTM" to cell references and switch between TTM or annual data dynamically by changing that cell. This helps in quickly toggling viewpoints between a specific quarter vs. the trailing year.

Common Questions and Troubleshooting

• "I keep getting 'NA'":

  • Ensure your MarketXLS subscription level includes historical fundamental data (Type4).
  • Verify the ticker symbol is correct.
  • Check that you passed valid Year and Quarter arguments.

• "Why is the quarter set to '2' if I omit it?"

  • The code designates a default of "1", but if the quarter is passed as an empty string, it internally resets to "2". Double-check your function inputs to ensure you pass your intended quarter.

• "Does this function support non-U.S. symbols?"

  • Generally, hf_revenue_usd is designed for U.S. fundamentals data. Some non-U.S. securities may not return data. Check symbol validity to confirm.

• "Can I combine TTM with various quarters?"

  • Yes. If you pass a quarter plus TTM, the function fetches the trailing data up to that quarter.

By integrating the hf_revenue_usd function into your Excel workflow, you can streamline fundamental analysis and quickly run revenue-based calculations or screeners without jumping between external tools. Test some of the advanced integrations to get even more value from MarketXLS and your dataset!