Thanks for your reply,
I need to calculate first in quantity values should be carry to first quantity values, if i buy 5 watches 10rs as a unit price of watch, then i sold 3 watches that out value should be from buy value.
I have added the FIFO logic in the Excel. I think the dates are kind of misleading here, but I think you will see the logic. BTW if you don't already know, FIFO is First In First Out. The inventory which came in first needs to be sold first before we sell the newer inventory.