---
title: Know what the goods you sold cost you this month.
description: Your AI calculates the month's COGS from the ERP's opening stock,
  purchases and closing stock, with its share of revenue and the source of every
  number.
language: en-US
canonical: https://www.siglata.com/en-US/trabalhos/cmv
---

# Know what the goods you sold cost you this month.

Canonical: https://www.siglata.com/en-US/trabalhos/cmv

Your AI reads the ERP's stock at the start and end of the month, the purchases and the sales, and saves each category's COGS, with the source of every number.

## Every month start, three exports and one sum

Stock comes out of the ERP on two dates, purchases come from the incoming invoices, and someone adds it up category by category in a spreadsheet copied from last month. When the closing stock is missing, the sum stops halfway.

## One question, each category's COGS

You ask for September's COGS. Your AI adds each category's opening stock and purchases, subtracts the closing stock, divides by revenue and saves the month as a new version of the COGS spreadsheet, with the previous one kept.

## Every number with its source

Tap a COGS amount to see the math, the file behind each part and the company's rule.

## The COGS rule is written down

Which cost values the stock, what counts as a purchase and which revenue the share is taken over live in a company skill. Each person works with their own access, and every change stays in the history, with the previous version kept.

1. Every month start, three exports and one sum: Stock comes out of the ERP on two dates, purchases come from the incoming invoices, and someone adds it up category by category in a spreadsheet copied from last month. When the closing stock is missing, the sum stops halfway.
2. Know what the goods you sold cost you this month.: Your AI reads the ERP's stock at the start and end of the month, the purchases and the sales, and saves each category's COGS, with the source of every number.
3. One question, each category's COGS: You ask for September's COGS. Your AI adds each category's opening stock and purchases, subtracts the closing stock, divides by revenue and saves the month as a new version of the COGS spreadsheet, with the previous one kept.
4. Every number with its source: Tap a COGS amount to see the math, the file behind each part and the company's rule.

| Category | Opening stock | Purchases | Closing stock | COGS | Revenue | COGS % |
| --- | --- | --- | --- | --- | --- | --- |
| Beverages | 18,400 | 32,600 | 16,800 | 34,200 | 52,300 | 65.4% |
| Dry grocery | 26,900 | 41,200 | 27,500 | 40,600 | 61,800 | 65.7% |
| Deli and dairy | 9,800 | 28,400 | 8,900 | 29,300 | 41,600 | 70.4% |
| Produce | 3,200 | 19,600 | 2,700 | 20,100 | 27,400 | 73.4% |
| Bakery | 1,600 | 12,300 | 1,400 | 12,500 | 24,900 | 50.2% |
| Meat | 5,400 | 30,800 | 4,900 | 31,300 | 44,200 | 70.8% |
| Wine | 22,500 | 14,800 | 21,300 | 16,000 | 26,700 | 59.9% |
| Coffee and tea | 6,700 | 9,400 | 6,200 | 9,900 | 17,900 | 55.3% |
| Cleaning | 7,300 | 8,600 | 7,800 | 8,100 | 11,900 | 68.1% |
| Personal care | 5,900 | 7,100 | 6,000 | 7,000 | 10,300 | 68.0% |
| Total | 107,700 | 204,800 | 103,500 | 209,000 | 319,000 | 65.5% |

### Total · COGS R$209,000.00


Opening stock on Aug 31: R$107,700.00, the same as the closing stock on v8's August sheet.


Purchases from Sep 1 to Sep 30: R$204,800.00.


Closing stock on Sep 30: R$103,500.00.


COGS: 107,700 + 204,800 − 103,500 = R$209,000.00.


September revenue: R$319,000.00.


COGS %: 209,000 ÷ 319,000 = 65.5%.

Estoque_2026-08-31.xlsx v1: 486 rows · sum of Value at cost: R$107,700.00
CMV_2026.xlsx v8: August sheet · Row 12 · Closing stock: R$107,700.00
Compras_setembro.xlsx v1: 1,214 rows from 93 invoices · sum of Total value: R$204,800.00
Estoque_2026-09-30.xlsx v1: 479 rows · sum of Value at cost: R$103,500.00
Vendas_setembro.xlsx v1: 512 rows · sum of Amount sold: R$319,000.00
CMV_do_mes : (company skill) · item 1: both stocks at average cost · item 2: purchases from the incoming merchandise invoices, with the invoice's freight · item 3: the share is over the month's sales

|  |
|  |


Stock fell by R$4,200.00 over the month (107,700 − 103,500), so COGS came out above purchases: 204,800 + 4,200 = 209,000. Produce has the highest COGS, 73.4% of its revenue.
CMV_2026.xlsx v8 to v9

Category · Opening + Purchases − Closing = COGS · COGS ÷ Revenue = COGS %

| Category | Opening + Purchases − Closing = COGS | COGS ÷ Revenue = COGS % |
| --- | --- | --- |
| Beverages | 18,400 + 32,600 − 16,800 = 34,200 | 34,200 ÷ 52,300 = 65.4% |
| Dry grocery | 26,900 + 41,200 − 27,500 = 40,600 | 40,600 ÷ 61,800 = 65.7% |
| Deli and dairy | 9,800 + 28,400 − 8,900 = 29,300 | 29,300 ÷ 41,600 = 70.4% |
| Produce | 3,200 + 19,600 − 2,700 = 20,100 | 20,100 ÷ 27,400 = 73.4% |
| Bakery | 1,600 + 12,300 − 1,400 = 12,500 | 12,500 ÷ 24,900 = 50.2% |
| Meat | 5,400 + 30,800 − 4,900 = 31,300 | 31,300 ÷ 44,200 = 70.8% |
| Wine | 22,500 + 14,800 − 21,300 = 16,000 | 16,000 ÷ 26,700 = 59.9% |
| Coffee and tea | 6,700 + 9,400 − 6,200 = 9,900 | 9,900 ÷ 17,900 = 55.3% |
| Cleaning | 7,300 + 8,600 − 7,800 = 8,100 | 8,100 ÷ 11,900 = 68.1% |
| Personal care | 5,900 + 7,100 − 6,000 = 7,000 | 7,000 ÷ 10,300 = 68.0% |
| Total | 107,700 + 204,800 − 103,500 = 209,000 | 209,000 ÷ 319,000 = 65.5% |

[Download the example (.xlsx)](https://www.siglata.com/en-US/trabalhos/cmv/planilha.xlsx)

Illustrative data.

## Frequently asked questions

### Which ChatGPT does it work in?

ChatGPT Business and Enterprise: an admin enables Siglata once for the team. On Pro, Siglata is read-only, in developer mode. On Plus and Free, it doesn't work in ChatGPT on the web. In Codex, each person connects it, on every plan that includes Codex.

### Does it work with my ERP?

Two ways: with the ERP's exports, as spreadsheets or CSV, and in the ERP's own pages, like Bling: your AI signs in to the portal with the login you or the company connected, reads lists and tables, clicks, fills in and posts, without seeing the password. The stock position, the incoming invoices and sales by product come in the same way, as a spreadsheet or CSV.

### How do I calculate COGS without a closing stock?

The formula can't do it. Without the closing stock, whatever is left on the shelf counts as sold. There are two ways. Count the stock on the month's last day, or export the ERP's balance on that date if the ERP tracks stock. Or add up, product by product, the quantity sold times the unit cost. That number leaves out losses and breakage. Your AI says which way it used and shows the row behind each value.

### What is the COGS formula?

COGS = opening stock + purchases − closing stock, with both stocks at the same cost. As a percentage, divide COGS by the same month's revenue. In this page's example, 107,700 + 204,800 − 103,500 = R$209,000.00, and 209,000 ÷ 319,000 = 65.5%.

## Want to see it with your company's stock?

We'll show it with the stock position, purchases and sales exported from your ERP, in a WhatsApp conversation.

[Let's talk](https://wa.me/5516991184410?text=Hi!%20I'd%20like%20to%20see%20the%20COGS%20calculation%20with%20Siglata.)
