The formula for calculating total variable costs is straightforward: Total Variable Costs = Cost Per Unit x Number of Units Produced For example, if the cost of raw materials per unit is $5 and you produce 1,000 units, the total variable cost would be $5,000.