Guide: how the cost of goods sold is determined for Mexican SMEs

Guide: how the cost of goods sold is determined for Mexican SMEs

Arturo A.

Digital Marketing Expert and AI Enthusiast

Learn how the cost of goods sold is determined and optimize the profitability of your SME in Mexico with practical examples, simple formulas, and current tips.

For many business owners, "cost of sales" sounds like just another complex accounting term. But in reality, it is one of the most important numbers you need to master. Think of it this way: it is the direct, straightforward cost of the products you sold. It is what you spent to be able to put that item into your customer's hands.

Without this number, you are flying blind.

Persona calculando el costo de ventas de un platillo en un restaurante, con una calculadora y documentos.

What exactly is cost of sales and why is it crucial for your SMB?

In essence, the cost of sales (also known as COGS or Cost of Goods Sold) is the sum of all expenses that can be directly attributed to a sold product. We are not talking about the rent of the premises or the manager's salary, but rather what it cost to produce or acquire that specific item.

For example, if you own a barbershop in the State of Mexico, your cost of sales is not just the wax or shampoo you use during a haircut. It should also include a fraction of the salary of the barber who performed the service. For a pharmacy in Nuevo León, the cost of sales encompasses what it paid for the medications, freight expenses to bring them to the branch, and any other acquisition costs.

In simple terms: Cost of Sales represents the total cost of the goods your company sold during a specific period. It excludes indirect expenses such as marketing, salaries of non-productive staff, or utilities. It is the pure cost of your sold inventory.

To calculate it, the basic formula is quite straightforward, but understanding its components is key.

Here is a table that breaks down the formula so you can apply it easily.

Key formula to calculate the cost of sales

Component

Description

Example (Coffee Shop in Puebla)

Beginning Inventory

The value of all your inventory at the start of the period (month, quarter, etc.).

You had $20,000 in coffee beans, milk, and syrups on January 1st.

Net Purchases

The total cost of all new inventory you acquired during that same period.

You purchased an additional $50,000 in supplies during the month.

Ending Inventory

The value of the inventory that remained unsold at the end of the period.

As of January 31st, you have $15,000 left in inventory.

With these figures, the calculation would be: $20,000 (Beginning) + $50,000 (Purchases) - $15,000 (Ending) = $55,000 (Cost of Sales). This is the real cost of all the coffee you sold in January.

The fundamental difference: cost of sales vs. cost of purchases

This is where many get confused, and it is a vital distinction for the financial health of your business.

The cost of purchases is simply the money you spent to acquire new inventory. On the other hand, the cost of sales focuses solely on the value of the inventory that was actually sold to customers. If you want to go deeper, understanding how the cost of purchases is calculated is essential for accurate inventory management.

Imagine you purchased $50,000 in merchandise for your barbershop in Monterrey. If at the end of the month you only used half in services, your cost of sales will be approximately $25,000 (not counting the inventory you already had). Confusing these two numbers can lead you to think you have lower profits than you actually do.

Why should this calculation be your priority?

Mastering your cost of sales gives you the power to answer questions that define the future of your business:

  • Are my prices profitable? If your selling price barely covers your cost, you are not building a sustainable business. COGS is your baseline to set healthy profit margins.

  • Which products are my real stars? By breaking down the cost per product, you can identify which ones leave you with the highest margin and which ones, even if they sell well, barely contribute to your profits.

  • Do I have leaks in my inventory? A cost of sales that spikes without an apparent reason can be a red flag. It could indicate anything from shrinkage and waste to theft or a poor purchasing strategy.

The current Mexican economy makes this control more necessary than ever. Consumer spending has shown impressive dynamism, averaging 13.52 trillion pesos since 1993 and reaching historic peaks of 18.29 trillion. More people buying means more opportunities, but also fierce competition. You can see more details of this trend in Mexican consumer spending on Trading Economics.

To compete, from a taco shop in Mexico City to a craft store in Baja California, you need pinpoint precision in your costs.

Ignoring the cost of sales is like trying to navigate the open sea without a compass. You might feel the wind of sales in your sails, but without knowing if you are heading toward profitability or straight into the rocks.

Choose the right inventory valuation method for your business

Once you understand the cost of sales formula, you run into a question that changes everything: how much is your inventory actually worth? The answer is not as straightforward as it seems, especially when the prices of your supplies or products keep changing. The way you value your stock will directly impact the calculation of your cost of sales and, therefore, your profit.

Imagine you own a coffee shop in La Condesa, in Mexico City. The bag of coffee from Chiapas that you bought in January did not have the same price as the one you acquired in March. So when you sell a latte, what cost do you assign to it? This decision is not merely accounting; it is a key piece of your financial strategy.

There are three main methods to value your inventory. Each has its pros and cons, and it is essential that you know them to choose the one that best suits your operation and your financial goals.

FIFO Method (First-In, First-Out)

The FIFO method operates under a very intuitive logic: the first thing that enters your warehouse is the first thing that must leave. It is like a bank line: the first person to arrive is the first to be served.

This approach is perfect for businesses with perishable products or expiration dates.

Practical example: an ice cream shop in Yucatán

Imagine an artisanal ice cream shop in Mérida, Yucatán, that receives fresh fruit every week. The strawberries they bought on Monday must be used before the ones from Wednesday so they do not spoil and generate waste.

  • By applying FIFO, the ice cream shop ensures that the cost of the oldest strawberries is assigned to the first sales of ice cream.

  • In an inflationary context, where fruit constantly rises in price, this method yields a lower cost of sales, since it uses the oldest and therefore cheapest purchase prices.

  • As a result, the reported gross profit is higher. This may sound good for attracting investors, but it could also mean a higher tax payment.

Here, the choice of method not only optimizes the operation to minimize waste, but also has a very tangible accounting and tax effect.

LIFO Method (Last-In, First-Out)

The LIFO method is just the opposite. It assumes that the last products you bought are the first ones you sell. Think of a stack of plates: you always take the one at the very top, the one you just put down.

This system might seem useful in industries where products do not expire and prices rise endlessly.

Important in Mexico: At a tax level, the Tax Administration Service (SAT) does not allow the deduction of the cost of goods sold using the LIFO method. Mexican regulations require using FIFO or Average Cost. Even so, it is worth understanding its logic for internal management and comparative financial analysis.

Practical example: a pharmacy in Nuevo León

An independent pharmacy in Monterrey buys boxes of a highly popular generic medication. In January, it acquires a batch at $100 per box. In March, due to inflation, it buys a new batch at $120.

  • If it used LIFO, when selling a box in April, it would record a cost of sales of $120, which corresponds to the cost of the last purchase.

  • This generates a higher cost of sales and, consequently, a lower gross profit. Although in theory this could reduce the tax burden, in practice it is not an accepted method for tax filing in Mexico.

Weighted average cost method

The Weighted Average Cost method offers a balance. Instead of tracking each batch, it calculates a single cost by averaging the value of all identical units you have in stock. The formula is simple: you divide the total cost of the products ready for sale by the total number of units.

It is a very popular method due to its simplicity and because it helps smooth the impact of price fluctuations. It is ideal for businesses with homogeneous inventories where it is impractical or almost impossible to track the cost of each item separately.

Practical example: a barbershop in the State of Mexico

The owner of a barbershop in Naucalpan sells a hair pomade that he buys at different prices during the year.

  1. Beginning Inventory: 10 pomades at $150 each (Total cost: $1,500)

  2. Purchase 1: 20 pomades at $160 each (Total cost: $3,200)

  3. Purchase 2: 15 pomades at $165 each (Total cost: $2,475)

Now he has 45 pomades in total, with an accumulated cost of $7,175. To find the average cost, simply divide: $7,175 / 45 units = $159.44 per pomade. From now on, every time he sells one, his cost of sales will be $159.44, regardless of whether it was from the first or the last purchase.

Implementing any of these methods correctly requires a very orderly system. Good inventory control is the foundation for accurate valuation. If you want to dive deeper into the best practices for keeping your records, we recommend exploring more about inventory logging in our article.

Theory is useful, but the real acid test for understanding how cost of sales is determined happens in the day-to-day trenches. Let's set aside abstract concepts for a moment and actually calculate it, applying the formula in two scenarios that any Mexican SMB will immediately recognize.

These examples will give you a clear idea of how the famous formula (Beginning Inventory + Purchases - Ending Inventory) materializes in your business operations.

Case study 1: A taco shop in Mexico City

Let's consider "El Sazón Chilango," a taco shop in the Roma neighborhood that needs to know if its tacos al pastor, the star product, are actually profitable. To find out, they want to calculate their cost of sales for the month of May.

The first thing done in practice is to break down the cost to its smallest expression: a single taco.

  • Ingredients per taco:

    • Al pastor meat (100 gr): $5.00

    • Corn tortilla: $0.50

    • Pineapple, onion, and cilantro: $0.75

    • Salsas and lime (proportional): $0.50

    • Raw material cost per taco: $6.75

But the cost does not end there. We must add direct labor. If the taco maker earns $8,000 monthly and dedicates half of his workday to tacos al pastor, we are talking about $4,000 of his salary that is directly attributed to this product. If in May they prepared 10,000 tacos, the labor cost per unit is only $0.40.

Unit cost of the product: $6.75 (raw material) + $0.40 (direct labor) = $7.15 per taco.

With this clear, now we can apply the general formula for the entire month of May, considering all supplies related to tacos al pastor.

  1. Beginning Inventory (May 1st): They started the month with supplies in the warehouse (meat, tortillas, etc.) valued at $8,000.

  2. Purchases of the month: Throughout May, they bought more raw materials for a total of $25,000.

  3. Ending Inventory (May 31st): At the close of the month, the physical count of the remaining supplies yielded a value of $6,500.

The cost of sales calculation is as follows: $8,000 (Beginning Inventory) + $25,000 (Purchases) - $6,500 (Ending Inventory) = $26,500

The cost of sales of "El Sazón Chilango" for its tacos al pastor was $26,500 in May. This data is pure gold, as it allows them to confirm if the selling price of each taco actually leaves the profit margin they expected.

Case study 2: A clothing boutique in Baja California

Now, let's switch industries and see how this works in the retail world. "Arena & Sol" is a boutique in Ensenada that sells handcrafted clothing from local suppliers. Their main challenge is tracking the actual cost of a batch of embroidered blouses, from the moment they buy them until they are sold.

This example is perfect to illustrate how additional costs, such as freight, which are a crucial part of the acquisition cost, should be treated.

  • Purchase of the batch: They acquire 50 blouses from an artisan in Yucatán. The cost per piece is $300, which gives a base cost of $15,000.

  • Shipping costs (Freight): Bringing the batch from Yucatán to Ensenada costs them $1,000. This is not an operating expense; it is a direct cost that must be added to the value of the inventory.

  • Total acquisition cost: $15,000 (blouses) + $1,000 (freight) = $16,000.

  • Unit cost: $16,000 / 50 blouses = $320 per blouse. Here is the real cost of each blouse placed in the store.

With the correct unit cost, they can now calculate their quarterly cost of sales.

  1. Beginning Inventory (January 1st): The store had merchandise valued at $30,000.

  2. Net Purchases: During the quarter, they purchased the batch of blouses and other items for a total of $50,000 (already including all freight).

  3. Ending Inventory (March 31st): After the physical count, the unsold merchandise has a value of $22,000.

The quarterly cost of sales is determined in this way: $30,000 (Beginning Inventory) + $50,000 (Purchases) - $22,000 (Ending Inventory) = $58,000

For "Arena & Sol," knowing that their quarterly cost of sales was $58,000 gives them the necessary visibility to analyze their performance, adjust prices, and better plan their next purchases.

The impact of new consumer habits

Mastering these calculations has become more critical than ever. The pandemic, for example, completely transformed buying habits, catapulting e-commerce and forcing SMBs to re-evaluate every cent of their costs. According to AMVO studies on e-commerce, 75% of Mexicans modified how they shop, and online orders for food and beverages skyrocketed by 164%. If you are interested in diving deeper, you can read the full analysis on the evolution of commerce in Mexico.

What both examples make clear is that, beyond the formula, the key is an impeccable record of each direct expense. At this point, a point-of-sale system that automates product inventory control ceases to be a luxury and becomes the best ally for any business seeking to operate with precision and ensure its profitability.

Common mistakes when calculating cost of sales and how to fix them

An incorrectly calculated cost of sales is one of the most dangerous and silent financial leaks a business can have. It leads you to set prices that do not cover your actual costs and to make strategic decisions with information that is, quite simply, incorrect.

I have seen many SMB and retail owners trip over the same stones. The good news is that identifying these slips is the first step to correcting them and shielding your profit margins. Let's look at the most frequent ones.

Mixing operating expenses with cost of sales

This is, without a doubt, the most classic mistake. It is very easy to throw local rent, the manager's salary, Facebook ads, and the cost of merchandise into the same bucket. But the reality is that they are completely different things.

The cost of sales (COGS) only includes costs that are directly tied to the product you sell. Everything else —electricity, water, administrative salaries, marketing— are operating expenses necessary for the business to run, but not to produce that specific unit you sold.

The solution is simple, but it requires discipline: separate accounts in your bookkeeping.

  • In your Cost of Sales account, you should find: raw materials, direct labor (the salary of the baker who bakes, not the accountant), freight to bring merchandise to your warehouse, and import costs.

  • In Operating Expenses goes everything else: administration and sales salaries, rent, utilities, advertising, etc.

Think of it this way: in a barbershop in Monterrey, the cost of wax, blades, and a portion of the barber's salary for the time spent on a haircut are COGS. The Instagram campaign to attract customers and the local rent are not.

Ignoring shrinkage and obsolete inventory

What do you do with the croissants that didn't sell today, the liters of milk that expired, or those t-shirts from last season that nobody wants anymore? If you simply make them "disappear" without an accounting record, your numbers will be lying to you.

I remember the case of a bakery in the State of Mexico. They did not record the bread they threw away at the end of the day. In their books, their ending inventory appeared higher than it was, which artificially lowered their cost of sales and shot up gross profit. On paper they were winning, but in the bank, money was missing.

Shrinkage is a cost, not an eventuality. Whether it is expired, damaged, or even stolen product, its value has to impact your finances. Ignoring it only gives you a false sense of profitability.

To fix this, you need a clear process to register all inventory write-offs.

  • Classify your write-offs: "Shrinkage due to expiration," "Damaged product in warehouse," "Shoplifting." Naming it helps identify issues.

  • Record its value: When you write off a product, its cost goes straight into the cost of sales for the period.

  • Rely on technology: Good inventory software is your best ally. It allows you to log these write-offs easily, keeping your numbers accurate and updated in real time. If you don't use one yet, I recommend reading about how inventory software can be your best ally in our article.

Forgetting indirect production costs

If your business manufactures or transforms products, the cost goes beyond raw materials. A very common blind spot is the depreciation of the machinery you use to produce.

Imagine a small artisanal ice cream shop in Puebla that invested $150,000 MXN in an ice cream making machine. If that machine has an estimated useful life of 5 years, then every year it loses $30,000 of its value.

This cost, even if it is not a monthly cash outflow, is a real production cost. It must be distributed somehow among all the liters of ice cream that are manufactured and sold.

The solution here is to talk to your accountant. Ask them to help you calculate the depreciation of your production assets (ovens, mixers, sewing machines) and to establish a method to assign a portion of that cost to your cost of sales. Failing to do so is, simply put, underestimating what it actually costs to make your product.

How Swirvle automates the calculation of your cost of sales

Persona usando un sistema de punto de venta táctil 'SWIRVLE Automatiza' en un mostrador comercial moderno.

If you have ever tried to track inventory and costs with spreadsheets and notes, you already know the nightmare. It is a bottomless pit of wasted hours, full of typos that throw everything off and, at the end of the day, leave you without a clear idea of how much you are actually making.

This is where technology becomes your best ally. An end-to-end platform like Swirvle doesn't just record sales; it is designed to dismantle this chaos and completely automate the cost of sales calculation. It's not magic, it's a connected ecosystem that hands control back to you with minimal effort on your part.

Total connection from your point of sale

It all starts at the counter. The engine of this automation is the point of sale system, which stops being a simple cash register to become the brain of your operation. Every time you scan a product and close a sale, Swirvle works in the background.

  • Sale made, inventory updated. That's it. No more manual counts at the end of the shift. If you sell a shirt or a medication, the system deducts that unit from stock instantly.

  • Valuation without manual calculations. The platform automatically applies the valuation method you have configured (either FIFO or Average Cost) to each item sold. This way, the cost of sales is always calculated correctly and consistently.

Let's think of a pharmacy in Mexico City. With each sale, the system not only knows which medication went out, but also from which specific batch, assigning it the exact purchase cost of that batch. This not only gives you impeccable financial visibility, but also helps you comply with traceability regulations.

Smart recipes: the secret for food businesses

Now, what if your business is more complex, like a coffee shop, a restaurant, or an ice cream shop? Calculating the cost of a dish with multiple ingredients is one of the biggest headaches. Swirvle's "recipes" feature is made precisely for this.

Imagine you have a coffee shop in Puebla. Inside the platform, you define the recipe for your "large cappuccino":

  • 30 grams of coffee beans

  • 200 ml of whole milk

  • 1 12-oz cup

  • 1 cup lid

The system already knows the unit cost of each of these supplies. The moment the barista rings up the sale of a cappuccino, Swirvle automatically sums the cost of those components, records it as the Cost of Sales of that drink, and deducts the precise quantities from the inventory of each supply. Suddenly, you know exactly the profit margin of each product you serve.

Attribution by branch, campaign, or even by salesperson

Knowing your total cost of sales is good, but the real power lies in the details. Swirvle allows you to segment that cost to deeply understand the performance of each part of your business.

This is where data transforms into business intelligence. You stop guessing and start answering key questions: Which branch manages its inventory best? Was the 2-for-1 promotion actually profitable or did it just cannibalize my margin? Which salesperson is most effective at moving products with higher profits?

  • Analysis by branch: You can compare the cost of sales of your store in Nuevo León against the one in Yucatán. Differences can reveal opportunities to negotiate with local suppliers, optimize logistics, or detect shrinkage.

  • Real ROI of your campaigns: You launch a coupon campaign for Mother's Day. With Swirvle, you don't just see the spike in sales; you measure the exact impact that discount had on your cost of sales and your final gross margin.

  • Team performance: Identify if certain salespeople tend to promote products with higher margins. This information is pure gold for designing training and commission schemes that align your team with profitability goals.

This granularity is crucial nowadays. With Mexico's growing participation in global trade —which consolidated in 2024 with exports of 651 million dollars, according to data from OEC.world— costs are more complex. An SMB might have to deal with tariffs, currency fluctuations, and import expenses that directly impact COGS. Swirvle helps you integrate and track these costs.

Through visual dashboards, you stop operating blind. You start making strategic decisions based on the certainty that only hard, real-time data can offer.

Answering the most common questions about cost of sales

Although formulas seem clear on paper, the day-to-day reality of a business always brings up very specific questions. Over time, I have seen that certain topics generate confusion again and again among SMB owners looking to fully understand how cost of sales is determined. Let's clarify the most important points.

Does the freight I pay to receive my merchandise count as cost of sales?

Absolutely. In fact, not doing so is a very common mistake. Think about this: those products would not be on your shelf or in your kitchen if you hadn't paid for their transport. That freight is a direct cost to acquire your inventory.

Therefore, you must add it to the value of your products. When you sell one of those items, a proportional part of that freight goes into the cost of sales. This should not be confused with the shipping you charge (or don't charge) to the final customer; that is already a selling expense, part of the operation.

What do I do with shrinkage or inventory that spoiled?

Shrinkage is the ghost of any business with inventory. We are talking about expired, broken, damaged products during transport, or even stolen goods. In accounting, this must be recorded as an inventory write-off, and its value is added to the cost of sales of the period in which the loss is detected.

Ignoring them is dangerous self-deception. If you don't record that shrinkage, your ending inventory in the books will be higher than the real one. This makes your cost of sales look lower than it is, artificially inflating your profit. Imagine an ice cream shop in Yucatán that loses several liters of ice cream due to a freezer failure; if they don't record it, they will believe they are making more money than they actually are.

Are my local rent and administrative salaries included?

No, and this is a crucial distinction. Rent, the salaries of your manager or accountant, what you invest in marketing, and utilities like electricity and internet are operating expenses.

Operating expenses keep the business running, but they are not directly tied to the production or purchase of a sold item. Cost of sales is exclusive to direct costs to have that product ready for sale.

Mixing these two worlds completely distorts your actual profit margin per product, which is the compass to know what is making you money and what is not.

Why doesn't my cost of sales calculation match my accountant's?

This is, perhaps, the source of greatest frustration I have seen. You show up with your numbers and the accountant presents others. Almost always, the discrepancy is due to one of these points:

  • Different valuation methods: Maybe you use a simple average to be practical, but your accountant is applying the FIFO (First-In, First-Out) method because it is the one required by tax regulations in Mexico.

  • Differences in criteria: Your accountant might be including in the direct cost something you overlooked, such as the depreciation of a key production machine, or vice versa.

  • Cutoff dates: A few hours' difference in the daily cutoff can cause a purchase invoice or a big sale to fall into a different accounting period for each of you, throwing off the entire calculation.

The only way out is to talk and standardize. Sit down with your accountant, define together which method you will use and what is included and what is not. The most important thing is that both start from the same data source, like a POS system, so there are not two versions of the truth.

Knowing how cost of sales is determined is the first step. The real game starts when you use that information to make decisions and grow. At Swirvle, we don't just automate your inventory and COGS calculations in real time, but we give you CRM and loyalty tools to convert that data into more sales, recurring customers, and higher profitability.

Discover how Swirvle can transform the management and growth of your business.

Try Swirvle for free

No card required · 30 days free

Start your free trial