I am trying to come up with a way to have a running total of who owns what stock and how much they still own. Not sure if a groupby function would do the trick? Attached is a sample file. With more instructions. I appreciate the help.
Alex
I am trying to come up with a way to have a running total of who owns what stock and how much they still own. Not sure if a groupby function would do the trick? Attached is a sample file. With more instructions. I appreciate the help.
Alex
Hi Alex,
Create a new column called "Movement" with the formula
=D2*IF(A2="Buy",1,IF(A2="Sell",-1,0))
Autofill etc.
This will create positive values for Buy and negative for Sell, 0 for undefined.
Then create a pivot table (Insert > Pivot Table) and set the source to A1:F20 (including the new "Movement" column).
Drag "Person" and "Stock" to Row Labels and then "Movement" to Values. It should default to "Sum of Movement".
PT.PNG
Beautiful. Thank You
You're welcome
If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks