Fransisco
Fransisco

Reputation: 11

(Google Sheets) How to Find the Day With the Most Wins/Losses

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.

Upvotes: 1

Views: 92

Answers (2)

player0
player0

Reputation: 1

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)

enter image description here

Upvotes: 0

Harun24hr
Harun24hr

Reputation: 36880

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)

enter image description here

Upvotes: 1

Related Questions