> For the complete documentation index, see [llms.txt](https://help.modelreef.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.modelreef.io/help/drivers-variables-and-timing/cogs-variables.md).

# COGS Variables

This article explains **COGS (Cost of Goods Sold) variables** in Model Reef.

You will learn:

* What a COGS variable represents.
* How COGS variables are typically driven by revenue or units.
* How COGS affects P\&L, working capital and cash.
* Patterns for modelling unit cost, margin and inventory like behaviour.

{% stepper %}
{% step %}

### What a COGS variable is

A **COGS variable** represents the direct cost of delivering revenue, for example:

* Cost of materials or goods sold.
* Direct labour that can be directly tied to production.
* Payment processing fees tied to revenue.
* Hosting costs closely linked to user activity.

Each COGS variable:

* Lives in a branch alongside its related revenue where possible.
* Has a category such as `COGS - Direct` or `COGS - Platform`.
* May use units, revenue or both as its basis.
  {% endstep %}

{% step %}

### How COGS variables use drivers

COGS variables are often tied tightly to revenue or units via drivers, for example:

* Unit cost pattern
  * `COGS = Units * UnitCostDriver`.
  * UnitCostDriver may itself change over time based on scale or inflation.
* Margin based pattern
  * `COGS = Revenue * COGSPercentDriver`.
  * Or equivalently `Gross Margin = Revenue * MarginPercentDriver`.
* Hybrid patterns
  * A fixed cost component plus a variable cost per unit.
  * Separate COGS variables for different product lines or channels.

Operational drivers supply units or activity levels. Economic or modifier drivers supply unit cost or percentage patterns.
{% endstep %}

{% step %}

### COGS in the P\&L

In the **P\&L**:

* COGS variables reduce Gross Profit.
* Categories and subcategories let you see COGS by product, channel or function.
* Gross Profit and Gross Margin are calculated from the combination of revenue and COGS variables.

This creates a transparent link between unit economics and headline margins.
{% endstep %}

{% step %}

### COGS, working capital and Accounts Payable

In the **Balance Sheet**:

* If COGS is paid in the same period as incurred, there is no payable.
* If there is a delay (for example supplier terms of 30 or 60 days):
  * COGS is accrued in P\&L when the cost is incurred.
  * An **Accounts Payable** balance is created to reflect the unpaid amount.
  * Accounts Payable decreases when cash is paid.

Although Model Reef does not model inventory as a separate stock account by default, delayed COGS combined with payables can approximate many inventory timing patterns.
{% endstep %}

{% step %}

### COGS in the Cashflow Statement and Cash Waterfall

In the **Cashflow Statement**:

* COGS variables feed into **Payments to suppliers** as cash outflows.
* Timing reflects payment terms rather than accrual timing.

In the **Cash Waterfall**:

* COGS is shown as a line directly under revenue, matching the P\&L.
* Changes in working capital then adjust for timing differences before capex, debt and equity flows.

This makes it easy to see both accrual margin and cash impact in one view.
{% endstep %}

{% step %}

### Common COGS modelling patterns

Examples:

* **SaaS or software**
  * COGS driven by user count or traffic, for example hosting and support.
  * Margin drivers showing COGS as a percentage of revenue.
* **Retail and ecommerce**
  * Unit cost driven COGS with volume discounts.
  * Supplier payment terms representing trade credit.
* **Manufacturing**
  * Material and direct labour cost per unit.
  * Capacity driven costs related to machine hours or production runs.

Each pattern uses COGS variables to encode the direct economic cost of delivering revenue.
{% endstep %}
{% endstepper %}

***

## Related articles

* [Multi-Project Consolidated Model](/use-cases/construction-and-contracting/multi-project-consolidated-model.md)
* [Build Cross Branch Drivers & Dependencies](/how-tos/data-workflows-and-automation/build-cross-branch-drivers-and-dependencies.md)
* [Opex Variables: what is, rules, what it affects](/help/drivers-variables-and-timing/opex-variables.md)
* [Selecting Variables in Sidebar](/syntax/formula-syntax/selecting-variables-in-sidebar.md)
