Forum Discussion

dlcartin's avatar
dlcartin
Iron Contributor
Aug 29, 2024
Solved

Need Formula for P/L for sale of a stock

I have a Table of stocks that I buy & sell. I need a Formula that will subtract my 'Sell Price' from my 'Buy Price' showing me any P/L that occurred once it has been sold (I don't do multiple buys of...
  • SergeiBaklan's avatar
    SergeiBaklan
    Aug 31, 2024

    dlcartin 

    Perhaps

    =IF([@UNITS]>0, 0,
     IF( [@SYMB]="", "",
        SUMPRODUCT(
            ([@DATE] >= [DATE] )*
            ([@SYMB] = [SYMB])*
            -[UNITS]*
            [$/Share]
        )
     ) )

Resources