I have a sheet collecting bet results
| Date | % investment | odds | won |
|---|---|---|---|
| 01/06/2021 | 2 | 1.12 | yes |
| 01/06/2021 | 2 | 1.09 | no |
| 02/06/2021 | 3 | 1.05 | yes |
I thought creating query filtering if the bet has been lost or won could help but I am stuck
=QUERY(bets!A1:D;"select A, sum(B), sum(C), count(A) where D = 'yes' group by A")With that I can have the victories with the some summary day by day.But this is not really what I want.
But the result I want is more complexThe initial bankroll amount is 100The result should be
| Date | invested % | invested amount | output | bankroll |
|---|---|---|---|---|
| 01/06/2021 | 4 | 4 | 0.24 | 96.24 |
| 02/06/2021 | 3 | 2.89 | 3.03 | 96.38 |
I do not know if I can do that with Google Sheet formulas, or I will need to use a script.