So I was given a formula which searches for values on columns B (buy/sell), C(ticker) and D(no of shares) with a reference cell A1 which indicates 'table' height.=UNIQUE(FILTER(OFFSET($C$3,0,0,$A$1),ArrayFormula(IF(SUMIF(OFFSET($C$3,0,0,$A$1)&OFFSET($B$3,0,0,$A$1),OFFSET($C$3,0,0,$A$1)&"buy",OFFSET($D$3,0,0,$A$1))-SUMIF(OFFSET($C$3,0,0,$A$1)&OFFSET($B$3,0,0,$A$1),OFFSET($C$3,0,0,$A$1)&"sell",OFFSET($D$3,0,0,$A$1))>0,TRUE))))
For my own use I needed to have a duplicate 'table' which is on column J (buy/sell), K(ticker) and L(no of shares). How do I modify the above formula to include data from this duplicate 'table' (same columns and also same height)?
| action | ticker | units |
|---|---|---|
| buy | AAPL | 10 |
| buy | MSFT | 5 |
| sell | AAPL | 10 |
| buy | SPY | 6 |
Which will then display MSFT and SPY in an output table since I have fully exited AAPL.
But because I want to line them up side by side because I want to calculate other column data (not evaluated by the formula above) I need the 'pairs' line up within the row.
| action | ticker | units | action | ticker | units |
|---|---|---|---|---|---|
| buy | AAPL | 10 | sell | AAPL | 10 |
| buy | MSFT | 5 | |||
| buy | SPY | 6 |










