If I have 2 stocks A & 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.
Bookmarks