+ Reply to Thread
Results 1 to 9 of 9

How do I calculate the gains/loses made from buying and selling a stock?

  1. #1
    Registered User
    Join Date
    12-29-2016
    Location
    US
    MS-Off Ver
    2016
    Posts
    13

    How do I calculate the gains/loses made from buying and selling a stock?

    If I bought and sold the same stock for many years, how can I calculate the total gains/loses made from all of the transactions assuming that I have a column containing all of the stock's prices, a column containing all of the buy dates, and a column containing all of the sell dates?

    Cross posts: http://www.msofficeforums.com/excel/...oses-made.html
    http://www.mrexcel.com/forum/excel-q...ing-stock.html
    Attached Files Attached Files
    Last edited by radiotower; 12-29-2016 at 11:01 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How do I calculate the gains/loses made from buying and selling a stock?

    Hi,

    You've not uploaded an example workbook so that we know your layout, but add the costs of all the buy trades and deduct it from the receipts from all the sell trades.

    To see a running total assuming the costs are listed starting in A2 and the receipts trades in B2, then in C2 use

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

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    12-19-2016
    Location
    India
    MS-Off Ver
    Office 2007
    Posts
    7

    Re: How do I calculate the gains/loses made from buying and selling a stock?

    Hi,

    To calculate gain/losses you need to have column identifying the stock sold on a date , so that you can lookup what prices on the date you bought and date of sale, once we get both prices we can use the logic (price sold - price buy )

  4. #4
    Registered User
    Join Date
    12-19-2016
    Location
    India
    MS-Off Ver
    Office 2007
    Posts
    7

    Re: How do I calculate the gains/loses made from buying and selling a stock?

    Hi,

    To calculate gain/losses you need to have column identifying the stock sold on a date , so that you can lookup what prices on the date you bought and date of sale, once we get both prices we can use the logic (price sold - price buy )

    Please provide your data example
    Last edited by AliGW; 12-30-2016 at 03:47 AM.

  5. #5
    Registered User
    Join Date
    12-29-2016
    Location
    US
    MS-Off Ver
    2016
    Posts
    13

    Re: How do I calculate the gains/loses made from buying and selling a stock?

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    You've not uploaded an example workbook so that we know your layout, but add the costs of all the buy trades and deduct it from the receipts from all the sell trades.

    To see a running total assuming the costs are listed starting in A2 and the receipts trades in B2, then in C2 use

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I attached a sample from my large spreadsheet. Essentially, any time you see a "1," that is the date I bought the stock. I would need to calculate the percent change of the stock price from that date until the date the stock was sold, which is represented by a "-1." As you can see, the stock was bought and sold many times over the years. So I would need to calculate all of the gains/loses to determine whether the decisions would have yielded an overall positive result (gain).

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: How do I calculate the gains/loses made from buying and selling a stock?

    Formulas ( all simple, nothing compounded, etc) :

    In E3, paste and copy down :
    Please Login or Register  to view this content.
    In F4, paste and copy down :
    Please Login or Register  to view this content.
    In G3, paste and copy down :
    Please Login or Register  to view this content.
    In H3, paste and copy down :
    Please Login or Register  to view this content.
    In I3, paste and copy down :
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Logit; 12-29-2016 at 08:19 PM.

  7. #7
    Registered User
    Join Date
    12-29-2016
    Location
    US
    MS-Off Ver
    2016
    Posts
    13

    Re: How do I calculate the gains/loses made from buying and selling a stock?

    Quote Originally Posted by Logit View Post
    Formulas ( all simple, nothing compounded, etc) :

    In E3, paste and copy down :
    Please Login or Register  to view this content.
    In F4, paste and copy down :
    Please Login or Register  to view this content.
    In G3, paste and copy down :
    Please Login or Register  to view this content.
    In H3, paste and copy down :
    Please Login or Register  to view this content.
    In I3, paste and copy down :
    Please Login or Register  to view this content.
    This approach assumes that I held the stock the entire time. In my case, I bought it and then sold it many times over the years.

  8. #8
    Forum Contributor
    Join Date
    05-02-2015
    Location
    calgary alberta
    MS-Off Ver
    2012
    Posts
    205

    Re: How do I calculate the gains/loses made from buying and selling a stock?

    As mentioned above previously. You have to indicate every time you bought and sold. And also how many units you bought and sold on that date. Also you need a starting point on how much money you started with? Seems like something your advisor or bank should have helped you with though. Orherwise stock tracking may be difficult for you?

  9. #9
    Registered User
    Join Date
    12-29-2016
    Location
    US
    MS-Off Ver
    2016
    Posts
    13

    Re: How do I calculate the gains/loses made from buying and selling a stock?

    I solved the problem.
    Last edited by radiotower; 12-29-2016 at 11:13 PM.

+ 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. [SOLVED] Average stock price after buying and selling, only for specific ticker
    By kpronine in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-16-2022, 09:23 AM
  2. [SOLVED] If formula for buying and selling mark
    By erlindafb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-29-2014, 05:59 AM
  3. Need a pivot table to calculate quantity per selling day
    By mikeTRON in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 08-29-2013, 02:07 PM
  4. Replies: 3
    Last Post: 03-05-2013, 11:42 AM
  5. [SOLVED] Trying to calculate tax and grat involved in set selling price.
    By loweyj in forum Excel General
    Replies: 4
    Last Post: 02-05-2012, 09:06 PM
  6. Calculate rent vs buying
    By newbiegirl in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 06-23-2011, 01:30 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