How to calculate stock value in Google Sheets

· 6 min read

Stock value is the amount of money sitting on your shelves. You need it when the accountant asks at year-end, when you insure the stockroom, and when you want to know why the bank balance is low while the shelves are full.

The sum is short: units in stock times what each unit cost you, added up across every product. The work is in keeping the two inputs honest. This guide uses the layout from how to track inventory in Google Sheets, where the Products tab has SKU in column A, Category in C, Unit cost in D, Selling price in E, Opening stock in F and Stock left in J. If your columns differ, change the letters and the formulas still hold.

The stock value formula for one product and for the whole sheet

  1. Add a Stock value column (K) on the Products tab. In K2 enter:

    =J2*D2

  2. Fill it down for every product row.

  3. In a cell away from the table, total it:

    =SUM(K2:K200)

With four products it looks like this:

SKU Product Category Unit cost Stock left Stock value
M-101 Blue mug Mugs 120 58 6,960
M-102 Red mug Mugs 120 25 3,000
P-201 Dinner plate Plates 180 30 5,400
T-301 Teapot Teapots 450 8 3,600

The total is 18,960.

If you only want the total and no extra column, SUMPRODUCT multiplies two ranges row by row and adds the results in one cell:

=SUMPRODUCT(J2:J200, D2:D200)

It gives the same 18,960. The two ranges must be the same size. The per-row column is still worth having, because it lets you sort by value and see which products hold the money. Here the 8 teapots are worth more than the 25 red mugs.

Use cost, not selling price

Stock value means what you paid. If the blue mug sells for 299, then 58 × 299 = 17,342 is what the shelf could bring in at full price, not what it is worth today. Both numbers are useful, and mixing them up is the most common mistake. If you want the second one, put it in its own column with =J2*E2 and call it Retail value.

Decide once what "cost" includes. If you pay freight or duty on every delivery, either add it into the unit cost for every product or leave it out for every product. A mix makes the total meaningless.

Stock value by category

To get the value held in one category, SUMIF adds up only the matching rows:

=SUMIF(C2:C200, "Mugs", K2:K200)

For the table above that is 6,960 + 3,000 = 9,960.

To list every category at once, QUERY builds the whole summary from one formula. Put this in an empty area or on a new tab (add Products! before the range if it is on another tab):

=QUERY(A1:K200, "select C, sum(K) where A is not null group by C label sum(K) 'Stock value'", 1)

Category Stock value
Mugs 9,960
Plates 5,400
Teapots 3,600

If you would rather click than type, a pivot table does the same job: choose Insert > Pivot table, add Category under Rows and Stock value under Values. Google's page on pivot tables shows the side panel.

When the supplier's price changes

Unit cost is a typed number, and it goes stale the day a delivery arrives at a new price. Say you hold 58 blue mugs bought at 120, and 42 more arrive at 130.

  • Leave the cost at 120 and the sheet says 100 × 120 = 12,000. That is 420 too low.
  • Overwrite it with 130 and the sheet says 13,000. That is 580 too high.
  • What you really paid is 58 × 120 + 42 × 130 = 6,960 + 5,460 = 12,420.

The fix is a weighted average cost. Before you record the delivery, work out:

New unit cost = (stock left × current cost + units delivered × delivery cost) ÷ (stock left + units delivered)

Typed into any spare cell: =(58*120+42*130)/(58+42), which gives 124.20. Type 124.20 into Unit cost, then add the delivery to Stock moves as usual. The sheet now shows 100 × 124.20 = 12,420.

This is one of two common methods. The international accounting standard for inventories, IAS 2, allows either first-in, first-out or weighted average cost for interchangeable items. First-in, first-out needs a record of each batch and its price, which is hard to keep in a simple sheet. Check which one your accounts use before you hand over a year-end figure. The same standard measures stock at the lower of cost and net realisable value, roughly what it would sell for after the costs of selling it, so damaged or unsellable items should not be carried at full cost.

Stock value on a past date

The Stock value column always shows today. For a month-end figure after the month has ended, count only the movements up to that date. In the next free column, type the date into the header cell, for example M1, and put this in M2:

=F2+SUMIFS('Stock moves'!D:D, 'Stock moves'!B:B, A2, 'Stock moves'!C:C, "In", 'Stock moves'!A:A, "<="&$M$1)-SUMIFS('Stock moves'!D:D, 'Stock moves'!B:B, A2, 'Stock moves'!C:C, "Out", 'Stock moves'!A:A, "<="&$M$1)

On the Stock moves tab, A is Date, B is SKU, C is Type and D is Quantity. The formula is opening stock, plus everything in, minus everything out, up to and including the date in M1. Take a blue mug with opening stock 40, a delivery of 24 on 2 November and a sale of 6 on 3 November. With 2 November in M1 the result is 40 + 24 − 0 = 64. Multiply by unit cost in the next column, =M2*D2, for 7,680.

Two limits to know about. The dates in Stock moves must be real dates, not text. And the formula uses today's unit cost, so if costs have changed since that date the figure is an approximation.

The simpler habit is to save the number on the day. At each month-end, copy the total cell and paste it into a small log (date in one column, value in the next) using Edit > Paste special and the values-only option, or Ctrl+Shift+V (⌘+Shift+V on a Mac). That stores the number itself, not a formula that will keep changing. Google lists the paste special options on its help site.

Two checks before you trust the total

  • Negative stock. =COUNTIF(J2:J200, "<0") counts products with stock left below zero. Each one subtracts from the total. It should be 0.
  • Missing costs. =COUNTIFS(A2:A200, "<>", D2:D200, "") counts products that have a SKU but no unit cost. Those are valued at nothing. It should also be 0.

Put both next to the total. A stock value with a 0 beside each check is one you can pass on. If either shows a number, find those rows first.

The sheet's figure is also only as good as the last physical count. It values what the sheet thinks is on the shelf.

Asking for the number

Everything above works in a plain spreadsheet. The BoltSheets inventory tracker template has the same Stock value column, stock left times unit cost. In the demo you can ask "what is the total value of our stock?" or "which category holds the most stock value?" and the answer is read from that column in the sheet. The template does not include the past-date or weighted average steps from this guide. BoltSheets is in early access and works with Google Sheets only.

If you have a reorder level for each product as well, the two numbers together tell you most of what a stock sheet is for: when to buy more, and how much money is already on the shelf.

Common questions

Should stock value use the cost price or the selling price?

Cost price, meaning what you paid the supplier. That is the money tied up on the shelf. Stock left times selling price is a different figure, the most you could take in if everything sold at full price, and it is worth keeping in a separate column.

Why is my stock value negative for one product?

Stock left for that product has gone below zero, so more units were recorded going out than were ever recorded coming in. Usually a delivery was never entered or the opening stock was wrong. Fix the missing row and the value corrects itself.

Do these formulas work in Excel?

SUM, SUMPRODUCT, SUMIF, SUMIFS, COUNTIF and COUNTIFS work the same way in Excel. QUERY is a Google Sheets function and does not exist in Excel, so use a PivotTable there for the value per category.

Which unit cost should I use when the supplier's price keeps changing?

A weighted average of what you paid for the units still on the shelf is the simplest method to keep up in a spreadsheet. Your accounts may use first-in, first-out instead, so ask whoever prepares them before relying on the sheet's figure for year-end.