Your post has gotten a fair number of views but no response. I'm going to guess that it's because your request is not entirely clear.
You mention FIFO (First In First Out) prominently, but that doesn't really seem to be an issue; it's more given starting stock, some new additions, some sales, what's the closing stock.
Then you highlight the yellow as if it's significant, and to be manual......why? Why isn't that number, as are the ones above it, a calculation based on all of the preceding?
Overall, you seem to be looking for a formula. You've already got what appear to be some sophisticated formulas in there. Are they not working as desired? Which ones? What formula (what box) are you wanting to be modified or corrected?