Cost of Revenue (Historical)

Returns historical cost of revenue (also known as Cost of Goods Sold or COGS) for a company. This represents the direct costs attributable to producing goods or services sold.

What is Cost of Revenue?

Cost of Revenue includes:

  • Direct materials
  • Direct labor
  • Manufacturing overhead
  • For services: direct service delivery costs

Gross Profit = Revenue - Cost of Revenue

Parameters

Parameter Required Description
Symbol Yes Stock ticker symbol
Year Yes Fiscal year (e.g., 2023) or period code (lq, ly)
Quarter No Quarter number 1-4 (default: 1)
TTM No Set to "TTM" for trailing twelve months

Period Codes

Code Meaning
lq Last quarter
lq-1 Two quarters ago
ly Last year
ly-1 Two years ago

Examples

=hf_Cost_of_Revenue("AAPL", "2023", "4")
Q4 2023 COGS
=hf_Cost_of_Revenue("MSFT", "2023", "3")
Q3 2023 COGS
=hf_Cost_of_Revenue("AAPL", "lq")
Last quarter COGS
=hf_Cost_of_Revenue("GOOGL", "2023", "4", "TTM")
TTM COGS
=hf_Cost_of_Revenue(A1, B1, C1)
Cell references

When to Use

  • Analyzing cost structure trends
  • Calculating gross margin
  • Building financial models
  • Comparing operational efficiency
  • Profitability analysis

When NOT to Use

Scenario Use Instead
Need current COGS CostOfRevenue()
Need gross profit hf_Gross_Profit()
Need operating expenses hf_Operating_Expenses()
Need revenue hf_Revenue()
Need net income hf_Net_Income()

Common Issues & FAQ

Q: Why am I getting "NA"? A: Check that:

  • The symbol is valid and has fundamental data available
  • The year/quarter combination exists in the data
  • The company has reported financials for that period

Q: How do I calculate gross profit? A: Gross Profit = Revenue - Cost of Revenue: =hf_Revenue("AAPL", "2023", "4") - hf_Cost_of_Revenue("AAPL", "2023", "4")

Q: What's included in cost of revenue? A: It includes all direct costs of producing goods/services: materials, direct labor, and manufacturing overhead.

Get Access to 1 Billion Usable Market data points IN YOUR EXCEL SHEETS WITH EASY TO USE EXCEL FUNCTIONS

Get started today
MarketXLS Excel Add-in Tutorial - How to Use Cost of Revenue (Historical) and Other Financial Formulas
How does MarketXLS work?