Domestic Sales (Historical) Formula in Excel
In this guide, we’ll explore how to use the Domestic Sales (Historical) formula in Excel with MarketXLS. This function helps you fetch a company’s domestic revenue for a specified year, quarter, or trailing period, making it easier to analyze performance and compare trends.
Understanding Domestic Sales (Historical)
- The
hf_Domestic_Sales
function retrieves the revenue generated from domestic customers for the selected equity or option. - It is particularly useful when you need to break down a company's revenue sources historically.
- Use this formula to gain insights into domestic market dependence, monitor year-over-year or quarter-over-quarter changes, and spot emerging sales trends.
? Pro Tip: Use different date and quarter parameters to compare domestic sales across multiple time periods quickly.
Syntax and Parameters
=hf_Domestic_Sales(Symbol, Year, [Quarter], [TTM])
Parameter | Description | Required | Example |
---|---|---|---|
Symbol |
The ticker or security symbol (equities, options, indices, crypto). | Yes | "MSFT" , ^SPX , "BTCUSD:DEFAULT" , ="@MSFT 110122C00020000" |
Year |
The fiscal year or special keyword (e.g., “ly”, “ly-1”, “lt”, “lq”, etc.). | Yes | 2022 , "ly" , "lq-1" |
Quarter |
The quarter number (1, 2, 3, or 4). Defaults to 1 if not specified. |
No | 2 , 3 |
TTM |
Optional switch to specify trailing twelve months. Enter "TTM" to get TTM data. |
No | "TTM" |
Return Value
A numeric value representing the domestic sales for the given symbol and period. If data is unavailable or the symbol is invalid, hf_Domestic_Sales
returns "NA"
.
?? Note: Make sure your MarketXLS license is active; otherwise, you may receive
"NA"
due to licensing limits.
Date Input Formats
You can enter the date or year using different approaches if needed for the Year
parameter:
- Cell references:
=hf_Domestic_Sales(A1)
- Direct dates:
=hf_Domestic_Sales("2024-03-15")
- Excel date functions:
=hf_Domestic_Sales(TEXT(A1,"yyyy-mm-dd"))
Examples and Usage
-
Basic yearly usage:
=hf_Domestic_Sales("MSFT", 2022)
Returns Microsoft’s domestic sales for the 2022 fiscal year.
-
Specifying quarter:
=hf_Domestic_Sales("MSFT", 2022, 2)
Returns domestic sales for the second quarter of 2022.
-
Year, quarter, and TTM:
=hf_Domestic_Sales("MSFT", 2022, 3, "TTM")
Retrieves trailing twelve-month domestic sales for the third quarter of 2022.
-
Using special keywords:
- Last quarter:
=hf_Domestic_Sales("MSFT", "lq")
- Last quarter minus one:
=hf_Domestic_Sales("MSFT", "lq-1")
- Last year:
=hf_Domestic_Sales("MSFT", "ly")
- Last year minus one:
=hf_Domestic_Sales("MSFT", "ly-1")
- Last 12 months:
=hf_Domestic_Sales("MSFT", "lt")
- Previous 12 months:
=hf_Domestic_Sales("MSFT", "lt-1")
- Last quarter:
? Pro Tip: For indices or crypto symbols, simply replace
"MSFT"
with^SPX
,"BTCUSD:DEFAULT"
, or any supported ticker.
Common Questions
Why am I getting “NA” as a result?
- The function returns
"NA"
if the symbol is invalid, your MarketXLS license is not valid for this feature, or the requested data is unavailable.
Can I use this with intraday data?
- No. The
hf_Domestic_Sales
function focuses on historical fundamental data rather than intraday updates.
Are there any performance considerations?
- The function queries data from MarketXLS servers. A stable internet connection ensures faster responses. Large batch requests can take longer, so consider using them in smaller sets.
How is this different from the “Revenue (Historical)” function?
hf_Domestic_Sales
narrows down to domestic revenues only, while the “Revenue (Historical)” function typically returns total revenue from all markets.
?? Note: Ensure your Excel settings allow external data calls to harness the full power of MarketXLS functions.