If I have 2 stocks A amp; B in a portfolio and the same stocks A and B are
in other portfolios. How can I return the correct number of shares I
own for a given stock in a given portfolio?
The data set is arranged by portfolio name and then the name of the
stock and then the number of shares.
I am trying to call the respective stock in the given portfolio so as
to return the number of shares therein.
I tried to use a sumif function which works if the stock is unique to a
portfolio. However if the same stock is in 2 portfolios I get back the
total number of shares.
Can someone suggest a solution that returns the correct number of
shares for a given stock for a given portfolio.--
aray
------------------------------------------------------------------------
aray's Profile: www.excelforum.com/member.php...oamp;userid=34547
View this thread: www.excelforum.com/showthread...hreadid=543144You may use SUM as an array formula. In you example, if you have your
porfolios in A1:A100, your stocks in B1:B100 and the shares in C1:C100 you
can use:
=SUM((A1:A100=quot;porfolioquot;)*(B1:B100=quot;stockquot;)*C1:C10 0)
Enter the formula with CTRL SHIFT ENTER, change the ranges and values as
appropiate.
Hope this helps,
Miguel.
quot;arayquot; wrote:
gt;
gt; If I have 2 stocks A amp; B in a portfolio and the same stocks A and B are
gt; in other portfolios. How can I return the correct number of shares I
gt; own for a given stock in a given portfolio?
gt;
gt; The data set is arranged by portfolio name and then the name of the
gt; stock and then the number of shares.
gt;
gt; I am trying to call the respective stock in the given portfolio so as
gt; to return the number of shares therein.
gt;
gt; I tried to use a sumif function which works if the stock is unique to a
gt; portfolio. However if the same stock is in 2 portfolios I get back the
gt; total number of shares.
gt;
gt; Can someone suggest a solution that returns the correct number of
gt; shares for a given stock for a given portfolio.
gt;
gt;
gt; --
gt; aray
gt; ------------------------------------------------------------------------
gt; aray's Profile: www.excelforum.com/member.php...oamp;userid=34547
gt; View this thread: www.excelforum.com/showthread...hreadid=543144
gt;
gt;
- Aug 14 Mon 2006 20:08
How to return the Number of shares for a given stock code for a given portfolio
close
全站熱搜
留言列表
發表留言