Firstly, this is my first post. I have been a lurker a couple of months though and find answers here invaluable. I want to put the masters to the test myself now with what I see as a tricky piece of business with Excel.
So here is my urgent Sunday brainteaser for you Excel genii...
The data I have consists of company name; date; name of shareholder; percentage of shares held for each of top 10 shareholders along the row.
In other words each row has variables:
Company ID; date; SH1; SH1%; SH2; SH2%; SH3; SH3% etc etc etc up to SH10%
I have a separate list of shareholder names I want to separate out into a binary variable (1/0) & a summation of the percentages for that firm at that time.
In other words, if John Doe, Jack Snow and Jane Schmoe are the shareholders I want to separate out then I will do the following:
...This seems to do the trick.![]()
Please Login or Register to view this content.
I can add more logical arguments to this to cover all the shareholder names I want to separate out. That part is no longer a big problem, thanks to this forum.
So here's my more tricky question to the masters:
Let's say my formula brings back a "1" - i.e. it finds either John or Jane as top 10 shareholders in ACME company, or alternative, it may have found John alone, or John, Jane and Jack or any such combination together in any of the positions 1 through to 10.
Now, instead of bring back a 1 or a 0, I want to do something different as follows.
If the formula finds only John Doe, or it finds Jack Snow, or it finds Jane Schmoe as top 10 shareholders, then I want their corresponding percentage holdings to be returned to the cell.
So for example, if the above code returns "1" into W2 because John Doe has 20% holding in the company, I want X2 to return "20%", which is going to be next to the cell in which John Doe appears, either as SH1, SH2, ... , SH10.
However, if both John Doe AND Jane Schmoe AND/OR Jack Snow appear in the top 10 for that row, I want X2 to return the sum of each of the cells NEXT TO (ie corresponding to) their shareholding. So if John has 10% and is SH4, Jane has 9% and is SH6 and Jack has 7% and is SH8, I want SH%4 SH%6 and SH%8 to be summed and returned to X2.
In exactly the same way, if the same row showed John was in fact SH1 with 60%; Jane was SH5 with 30% and Jack was SH10 with 2%, I would want the formula to return 92% to X2 (the sum of the shareholdings only of those 3 shareholders).
I hope that makes sense and I really need your help with this.
Best wishes,
Sam (UK North).
PS. I've now attached a sample of what I mean by the above, 2 posts down.
Bookmarks