+ Reply to Thread
Results 1 to 5 of 5

Spilled Array Trade Profit and Loss

  1. #1
    Registered User
    Join Date
    02-22-2022
    Location
    London, England
    MS-Off Ver
    Office 365
    Posts
    9

    Spilled Array Trade Profit and Loss

    Hi everyone,

    I want to use spilled array formulas to calculate PnL per trade based on a table containing all trades and the relevant data.

    The page "Ledger" contains the raw data.

    The page "Trade PnL" contains:

    1. The alphabetically sorted spilled arrays.
    2. The results I'd expect calculated manually i.e. without spilled arrays.
    3. My experiments and what I've got so far.

    As you'll see, it gets trickier when there are multiple buys end sells before a position is finally closed (Marked yellow in the sheet).

    Maybe I'm making it too complicated, maybe I'm incompetent, who knows :D

    Thank you very much for your help and ideas.

    I use basket averages to calculate the PnL.

    Best,
    calle
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Spilled Array Trade Profit and Loss

    Hi,
    you could use just one formula in "Trade PnL" cell B4.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Spilled Array Trade Profit and Loss

    Hi,
    I reviewed again your workbook and my formula previously suggested would cause too much trouble, so my new formula is just for the column B.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    For the calculation of the 'Average Purchase Price' I needed to create a new column 'Qty accumulated'.

    Average Purchase Price formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Qty accumulated formula:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I'm sending a file with the formula, but my version is Portuguese and it may not be translated to English even though when I opened your file it was translate to Portuguese formulas.
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,934

    Re: Spilled Array Trade Profit and Loss

    my version is Portuguese and it may not be translated to English
    It will, and that's why including a workbook for cross-locale assistance is important. But you should (as you have rightly done) also include formulae in the post. Thanks!
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: Spilled Array Trade Profit and Loss

    Tks for the information AliGW!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Spilled Array Trade Profit and Loss
    By callehaeberle in forum Excel General
    Replies: 3
    Last Post: 10-27-2023, 09:49 AM
  2. [SOLVED] Referencing Spilled Array to Create Spilled Array
    By truk2 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 05-30-2023, 11:21 PM
  3. [SOLVED] Calculate profit & loss based off of win/loss numbers
    By CNL1982 in forum Excel General
    Replies: 3
    Last Post: 01-09-2023, 08:04 AM
  4. Pivot table profit and loss by month - calculate gross profit and gross profit %
    By parkviewfinance in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 04-26-2020, 02:34 AM
  5. 1. consecutive days of profit and of losses 2. biggest profit loss since date
    By xbohemianx in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-14-2013, 12:57 PM

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