# How Average Cost is Calculated in Microsoft Dynamics NAV

We often get questions on how Dynamics NAV calculates Average Cost and have created a simple example below to illustrate.

The explanation below comes from a white paper entitled, “Dynamics NAV 5.0 Inventory Costing.”

The explanation of how to calculate Average Cost was explained as follows:

1. Determines the cost of the item at the beginning of the average cost period.
2. Adds the sum of the receipt costs that were posted during the average cost period. These include purchases, positive adjustments, outputs, and revaluations.
3. Subtracts the sum of the costs of outbound transactions that were fixed applied to receipts in the average cost period. These might include purchase returns and negative outputs.
4. Divides by the total inventory quantity as of the end of the average cost period, not including those inventory decreases that are being valued.

The program then applies this average cost to the inventory decreases for the item (or item, location, and variant) with posting dates in the average cost period. If there are any inventory increases that were fixed applied to inventory decreases in the period, the program forwards this average cost to these entries as well.

Date Entry Type Quantity Unit Cost Total Cost
10/7/2013 Positive Inventory Adjustment 10 10.00 100.00
10/7/2013 Purchase Receipt 20 15.00 300.00
10/7/2013 Sales Shipment -15 13.33 200.00
10/7/2013 Closing Entry 15 13.33 200.00

For October 7, there was zero on hand at the beginning of the day. The positive inventory adjustment for ten and the purchase receipt (increase) gives a total quantity of 30 and a total cost of 400.00. The average cost of the receipts was 13.33 (400.00 / 30). This cost of 13.33 was applied to the Sales Shipment (decrease) and was the average cost balance at the end of the day.

Date Entry Type Quantity Unit Cost Total Cost
10/8/2013 Opening Entry 15 13.33 200.00
10/8/2013 Purchase Receipt 30 10.00 300.00
10/8/2013 Sales Shipment -10 11.11 -111.11
10/8/2013 Closing Entry 35 11.11 388.89

For October 8, the opening balance of inventory was fifteen at the average cost carried over from the previous day. There was a Purchase Receipt (increase) for thirty at a unit cost of 10.00 and a total cost of 300.00. The total value of the increases was 500.00 for a total quantity of forty-five, giving an average cost of 11.11. The cost of 11.11 was applied to the Sales Shipment (decrease) and was the average cost of the remaining inventory at the end of the day.