Closed Thread
Results 1 to 6 of 6

First in First out (FIFO) accounting for equity trade's book cost

  1. #1
    Registered User
    Join Date
    04-10-2008
    Posts
    29

    First in First out (FIFO) accounting for equity trade's book cost

    Hi,

    I have a number of equity trades (both purchase and sales). I need to know the book cost of those sale trades to figure out the realized gain/loss according to First-in-first-out method.

    Since the unit sold may included units bought at different time and different price, so I have to first exhaust the first lot that I purchase before moving into second lot, and so on and so for.

    Column G - J are for illustration.
    I highlighted K10, K11 and K12 are book cost that I want to calculate. Instead of manually separating out units in each lot previously bought. Is there an automatic way? I would not mind adding new columns to ease calculation. Thanks.
    Attached Files Attached Files
    Last edited by computeruser08; 04-29-2009 at 09:03 AM.

  2. #2
    Forum Contributor vandanavai's Avatar
    Join Date
    09-04-2006
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    256

    Re: First in First out (FIFO) accounting for equity trade's book cost

    Hello

    see formulas in green coloured cells in attached file.
    I have changed columns in file and added UDF (User Defined Function ) called 'FIFOVal' in file.
    Hope this helps u.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    04-10-2008
    Posts
    29

    Re: First in First out (FIFO) accounting for equity trade's book cost

    thanks vandanavai.

    it works great. Could you also tell me how can i copy your function to apply in another excel file? i have an excel holding all the trades, so i have to move your UDF to that excel.

    another question, i press alt+f11 to see your module. u have three functions per below, if i am moving around columns in excel such as the sales quantity column, which function should i change to reflect that move of column?

    Public Function FIFOVal(rPurchase As Range, _
    rSales As Range, rUnits As Range) As Double

    Private Function FIFOBal(rPurchase As Range, _
    rSales As Range, rPrice As Range) As Double

    Private Function FillBuckets(rPurchase As Range, _
    rSales As Range) As Variant


    thanks. really appreciate the help.

  4. #4
    Forum Contributor vandanavai's Avatar
    Join Date
    09-04-2006
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    256

    Re: First in First out (FIFO) accounting for equity trade's book cost

    Hello

    U can just copy UDF code by inserting module in any excel file u want. I have not developed this UDF. I found the same on internet. So I can not give much explanation on how it works.

  5. #5
    Registered User
    Join Date
    09-10-2009
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: First in First out (FIFO) accounting for equity trade's book cost

    I've tried to incorporate your methodology to what I'm trying to do and have been getting errors. What I'm looking to do is FIFo for equity trades in order to calculate the correct realized P&L on sells. The buys get added to unrelaized.

    See attached spreadsheet.

    CJD
    Attached Files Attached Files

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: First in First out (FIFO) accounting for equity trade's book cost

    Please take a few minutes to read the forum rules, and then start your own thread.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1