If two people buy and then later sell several batches of the same stock at different prices over time, and:

  • one person tracks their profits using first-in-first-out (FIFO) accounting
  • the other person tracks using last-in-first-out (LIFO) accounting
  • all the buys and sells are for the same number of stocks at the same prices for the two people, the only difference is how they calculate the gains

Would they always come up with the same loss/gain in the end after all batches are sold?

Nothing to do with tax, just purely a math question. I'm just trying to figure out if how you track the lots as you sell the shares ever matters in the end. My gut feel is that it will always be the same in the end, but not sure how to prove it to myself for all cases.


Yes, the key thing is when all shares are sold, the total gains would be the same. It’s only the sales along the way that have different gains at the moment of the sale.

The difference is only important when considering taxes. But I think you knew that.

| improve this answer | |
  • Thanks Joe for confirming it without me having to do experiments in Excel! – Sandra Feb 21 '18 at 0:48
  • 1
    Most welcome, but for me there’s a joy to discovering such things on my own, and tinkering with spreadsheets is a pleasant pastime for me. Welcome to Money.SE !! – JTP - Apologise to Monica Feb 21 '18 at 0:51
  • 1
    If there is no E (taxes) then (A+B-C-D) = (A-C) + (B-D) = (A-D) + (B-C) = (A+B) - (C+D). No matter what the order of execution is, the end result is the same. – Bob Baerker Feb 21 '18 at 14:17
  • 3
    I knew "Associative" and "Commutative" properties would come in handy one day! – JTP - Apologise to Monica Feb 21 '18 at 14:21
  • 1
    @BobBaerker please recheck the 4th portion of that equation. (A+B) - (C-D) is not equivalent. Should be (A+B) - (C+D) – Shorlan Feb 21 '18 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.