Gross Margin (Historical)
Returns the historical gross margin (gross profit margin) for a company. This ratio measures the percentage of revenue remaining after cost of goods sold.
Formula
Gross Margin = (Revenue - Cost of Revenue) / Revenue = Gross Profit / Revenue
Parameters
| Parameter | Required | Description |
|---|---|---|
| Symbol | Yes | Stock ticker symbol |
| Year | Yes | Fiscal year or period code |
| Quarter | No | Quarter 1-4 |
| TTM | No | "TTM" for trailing twelve months |
Return Value
- Returns as decimal (0.45 = 45%)
- Higher values indicate better pricing power
Syntax
=hf_Gross_Margin(Symbol, Year, [Quarter], [TTM])Parameters
symbolstringRequired
Stock ticker symbol
yearstringRequired
Fiscal year or period code
quarterstring
Calendar quarter (1-4)
TTMstring
Set to 'TTM' for trailing twelve months
Returns
number
Gross margin as decimal (0.45 = 45%)
Examples
=hf_Gross_Margin("AAPL", 2023, 4)=hf_Gross_Margin("MSFT", "ly")=hf_Gross_Margin("GOOGL", 2023, , "TTM")=hf_Gross_Margin("AAPL", 2023)*100When to Use
- Analyzing pricing power
- Comparing profitability across companies
- Tracking margin trends
- Industry benchmarking
When NOT to Use
| Scenario | Use Instead |
|---|---|
| Operating margin | hf_Operating_Margin() |
| Net profit margin | hf_Profit_Margin() |
| Gross profit amount | hf_Gross_Profit() |
Common Issues & FAQ
Why is the value less than 1?
Gross margin is returned as a decimal. Multiply by 100 for percentage.
Why do software companies have high gross margins?
Software has minimal cost of goods sold compared to physical products.
Excel Templates Using Gross Margin (Historical)
These ready-made MarketXLS templates call hf_Gross_Margin() in their worksheet formulas. Open one to see the function working inside a complete model.
Related Formulas
More MarketXLS Historical Fundamentals formulas you can use in the same worksheet:
- Gross Profit Indicator (Historical)
- Gross Profit Margin (Historical)
- Hf Auditors Name Aud Name And Aud Op
- Hf Auditors Report Aud Name And Aud Op
- Hf Basic Eps From Continuing Operations
- Hf Basic Eps From Cumulative Effect Of Accounting Chg
- Hf Basic Eps From Discontinued Operations
- Hf Basic Eps From Extraordinary Income
