I've done some digging around and found some examples of what I'm looking for and tried to incorporate but not exactly working so I'm just looking for some more specific help. I am looking to determine the last 10 results of head to head matchups and also last 10 results overall. As you can see in the screenshot, the first 3 columns contains each player and D contains the results. Games/results are continuously added to the bottom. The "x" indicates who faced off in each game. What I'm finding confusing is finding each pIayer's last 5 results considering they might not have played the most recent game. I've tried using the following formula which contains the nested if and criteria but the formula just returns a value of 0 for Player A.

=COUNTIF(INDEX(D$2:D$1000,LARGE(IF(AND(D$2:D$1000="Player A", A$2:A$1000="<>"), ROW(D$2:E$1000)-ROW(D$2)+1),5)):D$1000,"Player A")

I would like to display it as a win-loss style similar to the records. I've been stuck here so I haven't had the opportunity to attempt at an overall last 5.

Thanks in advance for your time and help.

=COUNTIF(INDEX(D$2:D$1000,LARGE(IF(AND(D$2:D$1000="Player A", A$2:A$1000="<>"), ROW(D$2:E$1000)-ROW(D$2)+1),5)):D$1000,"Player A")

I would like to display it as a win-loss style similar to the records. I've been stuck here so I haven't had the opportunity to attempt at an overall last 5.

Thanks in advance for your time and help.