Find each shortfall
Subtract current stock from required cost. If stock is equal to or greater than the cost, the shortfall is zero and that row is ready. Blank stock is treated as zero; a blank cost leaves the row out of the summary.
shortfall = max(cost − stock, 0)