I'm looking for a solution that would give me a weighted average based on a dynamically filtered table.Here is what I have:
Date Ticker Trans Quant Value/unity Total Value market value11/03/2019 IRBR3 compra 6 R$ 91,08 R$ 546,48 R$ 6,5606/08/2019 MGLU3 compra 3 R$ 36,69 R$ 110,07 R$ 25,7107/08/2019 MGLU3 compra 5 R$ 36,00 R$ 180,00 R$ 25,7113/11/2018 BIDI4 compra 4 R$ 35,80 R$ 143,20 R$ 19,3515/03/2019 IRBR3 compra 2 R$ 88,04 R$ 176,08 R$ 6,5615/03/2019 BIDI4 venda 2 R$ 44,16 R$ 88,32 R$ 19,3514/01/2019 IRBR3 compra 6 R$ 79,73 R$ 478,38 R$ 6,5609/08/2019 MGLU3 compra 37 R$ 37,73 R$ 1.396,01 R$ 25,7109/08/2019 IRBR3 venda 15 R$ 99,83 R$ 1.497,45 R$ 6,56. . . . . . .. . . . . . .
What I want, is a formula that gives me an average for value/unity for each Ticker where Transaction is "compra".Anyone can help? I've created a google sheet so you can easily edit and understand how to get there.https://docs.google.com/spreadsheets/d/1xb9GCWJOGEW61THJ3Mmpok2iimZ8ZQtPtr-y7cWVPuI/edit?usp=sharing