ExcelNewbie150
New Member
- Joined
- Mar 6, 2024
- Messages
- 3
- Office Version
- 365
- Platform
- Windows
Hello
For a school project I have to analyze a stock portfolio with several lines of the same stock – Only thing that changes is the number of shares and the % of P&L like so
I would like to create a new spreadsheet in the workbook that merges and sums the lines like so:
where % P&L is the sum for all buys and this stock, # Trades the count of all trades for this side etc... I know this involves sums and countifs...but not so sure about how I go to create one line per item- Can you help?
For a school project I have to analyze a stock portfolio with several lines of the same stock – Only thing that changes is the number of shares and the % of P&L like so
Side | Stock | Price | % P&L |
Buy | Exxon Mobile | 20.95 | 0.0025 |
Buy | Exxon Mobile | 18 | 0.0014 |
Buy | Exxon Mobile | 20.1 | 0.0025 |
Sell | Exxon Mobile | 21 | 0.008 |
Sell | Exxon Mobile | 21 | 0.0016 |
Buy | Shell Plc | 29.32 | 0.0001 |
Buy | Shell Plc | 29.15 | 0.004 |
I would like to create a new spreadsheet in the workbook that merges and sums the lines like so:
Side | Stock | % P&L | # Trades |
Buy | Exxon Mobile | 0.0064 | 3 |
Sell | Exxon Mobile | 0.0096 | 2 |
Buy | Shell Plc | 0.0041 | 1 |
where % P&L is the sum for all buys and this stock, # Trades the count of all trades for this side etc... I know this involves sums and countifs...but not so sure about how I go to create one line per item- Can you help?