Iterate over a table row

I study Rock Paper scissor psychology using Excel. I save the games in a table named "Games" with the columns Player0 (which player used 0), Player1 and Winner (maybe 0, 1 or T for Tie).

enter image description here

I want to know how many winnings were made using each option (1) (table on the left), so I need to iterate over each row of the table to check whether the winnings were made using, for example, rock.

I tried using the following COUNTIF for rock

=COUNTIF( Games,   IF( IF( $D = 0, $B, IF( $D = 1, $C, FALSE ) ) = "R", TRUE, FALSE ) )

but I can’t figure out what to use to access other columns on the same row (instead of $ D, $ B, $ C).

Expected Value:

Rock Win - 3
, Paper Win - 0
, Scissor Win - 7
, Tie - 12

(1) Example: Rock Win would be a Rock vs Scissor match.

+4
2

Rock Win:

=COUNTIFS(C:C,"<>T",A:A,"R",B:B,"S")+COUNTIFS(C:C,"<>T",A:A,"S",B:B,"R")

Win:

=COUNTIFS(C:C,"<>T",A:A,"R",B:B,"P")+COUNTIFS(C:C,"<>T",A:A,"P",B:B,"R")

Scissor Win:

=COUNTIFS(C:C,"<>T",A:A,"P",B:B,"S")+COUNTIFS(C:C,"<>T",A:A,"S",B:B,"P")

Tie:

=COUNTIF(C:C,"T")

enter image description here

+1

I4

=COUNTIFS(C:C,"R",E:E,"0")+COUNTIFS(D:D,"R",E:E,"1")

R S, P ppapper siccor

I7 :

=COUNTIF(E:E,"T")

I8 :

=COUNTA(E:E)-1
OR
=SUM(I4:I7)

-1 .

, J4 :

=I4/$I$8

: .

POC

E:

=IF(C2=D2,"T",IF(OR(AND(C2="R",D2="S"),AND(C2="P",D2="R"),AND(C2="S",D2="P")),0,1))

( !

-, , I, , , :

I4-I 6

=SUMPRODUCT(($C$2:$C$23=LEFT($H4))*($D$2:$D$23="s")+($C$2:$C$23="s")*($D$2:$D$23=LEFT($H4)))

=SUMPRODUCT(($C$2:$C$23=LEFT($H5))*($D$2:$D$23="r")+($C$2:$C$23="r")*($D$2:$D$23=LEFT($H5)))

=SUMPRODUCT(($C$2:$C$23=LEFT($H6))*($D$2:$D$23="p")+($C$2:$C$23="p")*($D$2:$D$23=LEFT($H6)))

I7 E :

=SUMPRODUCT(--($E$2:$E$23=LEFT($H7)))

E :

=SUMPRODUCT(--(C2:C23=D2:D23))

, ,

=SUMPRODUCT(--(C2:C23<>""))

, , , . , , , .

+3

Source: https://habr.com/ru/post/1685364/


All Articles