+ Reply to Thread
Results 1 to 3 of 3

Conditional weighted average

  1. #1
    Registered User
    Join Date
    08-29-2017
    Location
    Brazil
    MS-Off Ver
    2010
    Posts
    2

    Question Conditional weighted average

    Hi all,

    I'm trying to calculate the average weighted entry price of a portfolio of stocks.

    However, imagine I have a list of chronological transactions and that eventually I could exit a position and then start again.
    (i.e. I could sell my stocks on company A and then buy again later on)

    The calculations of my average entry price should only include the transactions after I started the new position.
    If simply "do the math" Excel will consider all transaction and calculate the weighted average for ALL transactions instead for the relevant ones. How can I include a condition for only averaging the appropriate transactions?

    I've created a sample file that shows the problem. Could anyone please take a look?

    Thanks in advance!
    Bruno
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,406

    Re: Conditional weighted average

    Hi Bruno. Welcome to the forum.

    Not sure where weighted average fits the instructions. The formula in the upload and expected returns suggest this is what you want.

    In cell I3 and filled down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  3. #3
    Registered User
    Join Date
    08-29-2017
    Location
    Brazil
    MS-Off Ver
    2010
    Posts
    2

    Re: Conditional weighted average

    Hi Dave, thanks a lot for the help.

    It needs to be a weighted average to calculate the average price of the amount held - your solutions works fine for the case with the stock A but it doesnt for stock C, which should be a weighted average of the trades - 3000 @ 150 + 3000 @ 170 = 6000 stocks @ weighted average price of 160.

    Any thoughts?

    Thanks again.

+ 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] Want to make weighted average formula conditional
    By Butcher1 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-10-2016, 09:23 AM
  2. Query regarding Calculating Weighted average value or average value in Percentage.
    By adamsmith1337 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-03-2016, 07:56 AM
  3. [SOLVED] Weighted Average, Dynamic Range, Conditional Dashboard
    By MIACG in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-27-2014, 05:32 PM
  4. Weighted Average IF (sumproduct conditional)
    By Leopold2000 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-16-2013, 03:27 PM
  5. Conditional weighted average ignoring #N/A values
    By syoung27 in forum Excel General
    Replies: 4
    Last Post: 02-22-2012, 10:48 AM
  6. Conditional weighted average
    By saturnexcel in forum Excel General
    Replies: 8
    Last Post: 04-20-2009, 04:06 PM
  7. [SOLVED] What is this kind of average called?-weighted average
    By havocdragon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-24-2005, 01:05 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