I am building a personal trading journal with a very limited knowledge of spreadsheets formula, and decided to ask here after several failed attempts.
I want to achieve this:
Trade Result (column A) | Trading Day (column B) |
---|---|
Win | Monday |
Loss | Tuesday |
Win | Monday |
Win | Tuesday |
Loss | Wednesday |
Loss | Wednesday |
Win | Monday |
Win | Monday |
Loss | Friday |
From above, we know that the day with the most wins: Monday
.
Day with the most losses: Wednesday
How do I achieve that Monday
for the day with the most wins, and Wednesday
for the day with the most losses?
Appreciate the help. Thank you very much.
CodePudding user response:
Try below formula-
=INDEX(SORT(({$B$2:$B$10,COUNTIFS($B$2:$B$10,$B$2:$B$10,$A$2:$A$10,C3)}),2,0),1,1)
CodePudding user response:
use:
=ARRAY_CONSTRAIN(SORTN(QUERY({A:B},
"select Col1,Col2,count(Col2)
where Col1 is not null
group by Col1,Col2
order by count(Col2) desc
label count(Col2)''"), 9^9, 2, 1, 0), 9^9, 2)