# Profit Margin (Historical)

Live
the amount by which revenue from sales exceeds costs in a business.

### How calculated

You can calculate profit margin ratio by subtracting total expenses from total revenue, and then dividing this number by total expenses. The formula is: ( Total Revenue - Total Expenses ) / Total Revenue.

### Example usage

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

Stocks