# Gross Margin (Historical)

Live
The amount of money a company retains after incurring the direct costs associated with producing the goods it sells and the services it provides

### How calculated

Net Sales - Cost of Goods Sold

### Example usage

=hf_Gross_Margin("MSFT",2021) - Returns the value for the year 2021.
=hf_Gross_Margin("MSFT",2021,2) - Returns the value for the year 2021 and the calendar quarter 2
=hf_Gross_Margin("MSFT",2021,3,"TTM") - Returns the value for the year 2021 and trailing twelve months from the calendar quarter
=hf_Gross_Margin("MSFT","lq") - Returns the value for the last quarter
=hf_Gross_Margin("MSFT","lq-1") - Returns the value for the last quarter-1
=hf_Gross_Margin("MSFT","ly") - Returns the value for the last year
=hf_Gross_Margin("MSFT","ly-1") - Returns the value for the last year - 1
=hf_Gross_Margin("MSFT","lt") - Returns the value for the last 12 months.
=hf_Gross_Margin("MSFT","lt-1") - Returns the value for the previous last 12 months.

### Notes

The gross margin varies by industry, however, service-based industries tend to have higher gross margins and gross profit margins as they don't have large amounts of COGS. On the other hand, the gross margin for manufacturing companies will be lower as they have larger COGS.

Stocks