Grocery weighted-average stock valuation calculator

Calculate valuation [SKU,weighted unit cost,counted value,quantity discrepancy] and total counted value with your own figures.

Your numbers

Use the units shown. Results update as you change valid inputs.

Choose the currency for these amounts. Changing it keeps your numbers and does not convert exchange rates.

Use valuation [SKU,weighted unit cost,counted value,quantity discrepancy] and total counted value to compare changes to your inputs. The method and limits below explain the scope.

Examples

Examples

Try the starting example

Items [SKU,counted units,book units,[[cost-layer units,currency/unit],...]]; enter JSON (USD)
[["A",12,10,[[10,2],[10,3]]],["B",5,6,[[10,4]]]]
Valuation [SKU,weighted unit cost,counted value,quantity discrepancy] (JSON) (USD)
[["A",2.5,30,2],["B",4,20,-1]]
Total counted value (USD)
$50.00

Try another scenario

Items [SKU,counted units,book units,[[cost-layer units,currency/unit],...]]; enter JSON (USD)
[["A",15,14,[[10,3],[20,4]]],["B",8,8,[[10,5]]]]
Valuation [SKU,weighted unit cost,counted value,quantity discrepancy] (JSON) (USD)
[["A",3.66666666667,55,1],["B",5,40,0]]
Total counted value (USD)
$95.00
Calculation method

Calculation method

Valuation [SKU,weighted unit cost,counted value,quantity discrepancy] (JSON) (USD)

Weighted unit cost=sum(layer qty×cost)/sum layer qty; counted value=count×weighted cost; discrepancy=count−book.

Total counted value (USD)

Sum item counted values rounded per item.

Symbols and units
a
Items [SKU,counted units,book units,[[cost-layer units,currency/unit],...]]; enter JSON (USD)

Use the units shown. A list keeps the order in which you enter its values. The symbol ^ means “raised to the power of”.

Calculation steps and notation

sum(list) adds all entries in the list.

Assumptions & limits

Assumptions & limits

  • Weighted-average supplied cost layers, with counted-vs-book discrepancy; does not implement FIFO/LIFO or accounting-policy selection. Supported limits: All numeric inputs and computed intermediates must remain finite. Supported numeric input magnitude is zero or 1e-12 through 1e12 in absolute value; reject values outside this bounded range. All lists/JSON record tables are limited to 100 records unless a stricter bound is stated; reject malformed record arity and wrong member types. Layer quantities positive; count/book integers>=0; costs>=0; weighted-average convention only.
Are these inputs private?

These calculations run in your browser. A shared link contains the values you choose to share. Only questions submitted to the separate AI finder are sent to OpenAI.

Share this page
Share this calculator

Leave unchecked to share the page without your entered values.