SOLVED

Caalculate Profiit and Loss column for multiple buy and sell entries of similar stock

%3CLINGO-SUB%20id%3D%22lingo-sub-2402474%22%20slang%3D%22en-US%22%3ECaalculate%20Profiit%20and%20Loss%20column%20for%20multiple%20buy%20and%20sell%20entries%20of%20similar%20stock%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2402474%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThankyou%20for%20help%20in%20advance.%20i%20am%20currently%20working%20on%20a%20work%20system%20for%20my%20trading%20and%20I'm%20stuck%20at%20this%20point.%26nbsp%3B%3CBR%20%2F%3Ei%20have%20multiple%20buy%20entries%20of%20one%20stock%20..comprising%20multiple%20quantities...and%20I'm%20calculating%20the%20profit%2F%20loss%20by%20subtracting%20my%20entry%20point%20from%20the%20actual%20live%20market%20price.(*quantity)%3CBR%20%2F%3E%3CBR%20%2F%3EBut%20my%20issue%20is%20when%20Im%20selling%20a%20particular%20stock%20...how%20do%20I%20get%20the%20profit%2F%20loss%20(for%20that%20particular%20sell%20quantity)%20based%20of%20on%20multiple%20buy%20of%20that%20stock%20before.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3Efor%20example%20in%20my%20below%20attached%20excel%20on%20sheet%20-%20%22TRADE%20JOURNAL%20%22%3CBR%20%2F%3Ethe%20are%20multiple%20%22buy%22%20stocks%20initially%20and%20if%20you%20can%20see%20the%20in%20column%20Q%20i%20was%20able%20to%20calculate%20the%20current%20profit%20and%20loss%20by%20subtracting%20my%20entry%20price%20from%20the%20live%20current%20trading%20price%20*%20quantity%20......but%20when%20I'm%20selling%20(SELL)%20In%20line%2013%2C%26nbsp%3B%20I'm%20afraid%20this%20logic%20will%20not%20work.%26nbsp%3B%3CBR%20%2F%3Ewhen%20I'm%20selling%20...i%20only%20enter%20my%20exit%20price%20and%20exit%20quantity.....to%20calculate%20the%20P%2FL%20the%20buy%20price%20shud%20be%20the%20average%20of%20all%20the%20entry%20prices%20of%20that%20particular%26nbsp%3B%20stock%20before%20corresponding%20to%20the%20buy%20quantities...May%20be%20i%20wud%20need%20to%20segregate%20my%20P%2FL%20by%20realised%20and%20unrealized...can%20anybody%20please%20help%20me%20out%20in%20how%20to%20go%20about%20it.%20Feel%20free%20to%20edit%20the%20excel%20sheet%20if%20needed.%26nbsp%3B%3CBR%20%2F%3EMy%20ultimate%20goal%20is%20to%20calculate%20the%20my%20current%20profit%20or%20loss%20(based%20on%20individual%20transactions)%20hope%20i%20make%20sense.%26nbsp%3B%3CBR%20%2F%3EYour%20assistance%20is%20greatly%20appreciated.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2402474%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBI%20%26amp%3B%20Data%20Analysis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2402642%22%20slang%3D%22en-US%22%3ERe%3A%20Caalculate%20Profiit%20and%20Loss%20column%20for%20multiple%20buy%20and%20sell%20entries%20of%20similar%20stock%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2402642%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1066303%22%20target%3D%22_blank%22%3E%40mohammed3786%3C%2FA%3E%26nbsp%3BPerhaps%20the%20attached%20sheet%20helps.%20I%20added%20a%20column%20to%20calculate%20the%20averages%20and%20changed%20some%20formulae.%20The%20changes%20are%20in%20the%20columns%2Fcells%20with%20the%20yellow%20headers%2Fbackground.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2404898%22%20slang%3D%22en-US%22%3ERe%3A%20Caalculate%20Profiit%20and%20Loss%20column%20for%20multiple%20buy%20and%20sell%20entries%20of%20similar%20stock%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2404898%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F403176%22%20target%3D%22_blank%22%3E%40Riny_van_Eekelen%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EHi%20Riny%2C%20thankyou%20for%20your%20reply%20and%20effort.%20i%20was%20studying%20the%20excel%20sheet%20and%20i%20understood%20what%20you%20have%20done%2C%20however%20i%20can%20you%20help%20me%20address%20the%20following%20query%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ein%20the%20excel%20attached%20i%20have%20tweaked%20a%20little%20to%20show%20the%20%22SELL%20%22action%20p%2Fl%20as%20realised%20P%2FL%20in%20the%20S%20column..lets%20consider%20the%20three%20transactions%20on%20rows%208%2C10%20n%2013....the%20idea%20is%20the%20first%20two%20buy%20transactions%20of%20Steel%20authority%20of%20India%20gives%20me%20a%20loss%20of%20((-3100-5262.5%3D-8362.5)....now%20when%20i%20SELL%20Steel%20authority%20of%20India%20in%20the%2013th%20row%20...this%20loss%20of%20(-832.5%20in%20S13)%20is%20a%20part%20of%20the%20-8362.5..(%20this%20-832.5%20is%20realised%20out%20of%20-8362.5)..i%20hope%20I'm%20making%20sense.%3C%2FP%3E%3CP%3Eso%20now%20my%20overall%20position%20on%20steel%20authority%20of%20inida%20is%20-7530.%20with%20remaining%20400%20shares%3CBR%20%2F%3E%3CBR%20%2F%3Eis%20thr%20any%20way%20i%20can%20show%20this%20(-7530)%20maybe%20in%20a%20different%20column%20for%20every%20script%20where%20I%20stand%20%3F%3CBR%20%2F%3ESo%20for%20Steel%20authority%20of%20inida%20i%20stand%20at%20-7530%20after%20three%20transactions%20....similarly%20for%20every%20other%20stock..%3CBR%20%2F%3E%3CBR%20%2F%3Emy%20other%20query%20is%20...is%20the%20any%20way%20I%20can%20show%20the%20open%20transactions%20in%20yellow%20and%20if%20I%20sell%20all%20the%20quantities%20of%20a%20particular%20stock%20i%20had...then%20the%20row%20wud%20automatically%20turn%20back%20to%20white%3F%3CBR%20%2F%3E%3CBR%20%2F%3Eyr%20input%20is%20highly%20appreciated.%20Thankyou%20very%20much%20Riny.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello 

Thankyou for help in advance. i am currently working on a work system for my trading and I'm stuck at this point. 
i have multiple buy entries of one stock ..comprising multiple quantities...and I'm calculating the profit/ loss by subtracting my entry point from the actual live market price.(*quantity)

But my issue is when Im selling a particular stock ...how do I get the profit/ loss (for that particular sell quantity) based of on multiple buy of that stock before. 

for example in my below attached excel on sheet - "TRADE JOURNAL "
the are multiple "buy" stocks initially and if you can see the in column Q i was able to calculate the current profit and loss by subtracting my entry price from the live current trading price * quantity ......but when I'm selling (SELL) In line 13,  I'm afraid this logic will not work. 
when I'm selling ...i only enter my exit price and exit quantity.....to calculate the P/L the buy price shud be the average of all the entry prices of that particular  stock before corresponding to the buy quantities...May be i wud need to segregate my P/L by realised and unrealized...can anybody please help me out in how to go about it. Feel free to edit the excel sheet if needed. 
My ultimate goal is to calculate the my current profit or loss (based on individual transactions) hope i make sense. 
Your assistance is greatly appreciated. 


3 Replies
best response confirmed by mohammed3786 (Occasional Contributor)
Solution

@mohammed3786 Perhaps the attached sheet helps. I added a column to calculate the averages and changed some formulae. The changes in the TRADE JOURNAL are in the columns/cells with the yellow headers/background.

@Riny_van_Eekelen 

Hi Riny, thankyou for your reply and effort. i was studying the excel sheet and i understood what you have done, however i can you help me address the following query

 

in the excel attached i have tweaked a little to show the "SELL "action p/l as realised P/L in the S column..lets consider the three transactions on rows 8,10 n 13....the idea is the first two buy transactions of Steel authority of India gives me a loss of ((-3100-5262.5=-8362.5)....now when i SELL Steel authority of India in the 13th row ...this loss of (-832.5 in S13) is a part of the -8362.5..( this -832.5 is realised out of -8362.5)..i hope I'm making sense.

so now my overall position on steel authority of inida is -7530. with remaining 400 shares

is thr any way i can show this (-7530) maybe in a different column for every script where I stand ?
So for Steel authority of inida i stand at -7530 after three transactions ....similarly for every other stock..

my other query is ...is the any way I can show the open transactions in yellow and if I sell all the quantities of a particular stock i had...then the row wud automatically turn back to white?

yr input is highly appreciated. Thankyou very much Riny.

@mohammed3786 Please see the attached workbook. Added yet another column using two SUMIF functions in one formula. Not sure though it this really does what you want/need.