Rain’s formula looks correct.
Stock On Hand = Last Stocktake + Purchases since last Stocktake - Sales since Last Stocktake.
Now let’s look at it without the Last Stocktake…
Stock On Hand = Purchases since last Stocktake - Sales since Last Stocktake.
If both Purchases since last Stocktake and Sales since Last Stocktake are zero then Stock On Hand is zero.
So, if a company starts trading with 1000 widgets on hand then the reported Stock On Hand would be zero.
Since we don’t know what is in stock let’s look at another way to look at quantity on hand…
We have a tank with some liquid in it and the current quantity can be calculated by input flow – output flow.
However, that will only work when starting from 0 quantity. And it will only work if both measurements are perfectly accurate. But the measurements are not perfectly accurate, no measurements are. So an error exists and that error can be said to be the time integral of the difference between the two inaccuracies. If the difference between the two inaccuracies is positive then the error in quantity is positive and if the difference between the two inaccuracies is negative then the error in quantity is negative. What’s more is that the absolute error in quantity increases with time.
To correct the situation a certified dip of the tank is made periodically. The dip produces a known quantity to the best of its measurement capability. But the dip’s measurement capability is static and not changing over time.
So the error in the instantaneous quantity on hand is limited to the time integral of the difference between the inaccuracies of the two flow meters plus the static inaccuracy of the certified dip. Therefore, the instantaneous error of quantity on hand is largely governed by the time between dips. The more often the dips the less the error, the less often the dips the greater the error.
Instantaneous Quantity in Tank = Static Last Dip Measurement + Time Integral Since Last Dip of (Sum(Inflow +/- error) – Sum(Outflow +/- error)).
However, that formula will not work under some circumstances. Notoriously bad are quantity measurements in boiler drums. In this case the level is measured continuously but it can’t be measured accurately so a different approach is taken. Due to the inaccuracy of the instantaneous level measurement the time integral of the measurement is used instead. The time integral of the measurement is done every 10 minutes or so (10 minute stocktake) and the inaccuracies of the flow measurements then become trivial.
Instantaneous Quantity in Tank = Time Integral of (Level Measurement) + instantaneous inflow – instantaneous outflow.
There is a similarity between both calculations though. In both cases the Level and the Flows need to be considered in order to get a quantity.
The dips equate to a manual stocktake, but even a manual stocktake can be in error due to bad counting. If a stocktake is in error that error remains static until the next stocktake. The stocktake error does not grow with time, only the in and out quantities +/- errors integrate with time.
Chris.