How to show last 5 games team's form

VKiprijan

New Member
Joined
Feb 24, 2021
Messages
40
Office Version
  1. 2016
Platform
  1. Windows
Hi Everyone,

I have a soccer league table with rankings in which I would like to show each team's form in the last 5 games played (Wins, Draw, Loss). What formula do I need to use in the columns CT thru CX in order to show this kind of statistics for each team?

Thank you all in advance.

Cell Formulas
RangeFormula
BR7:BR24BR7=RANK(CC7,$CC$7:$CC$24)
BS7:BS24BS7=SUMPRODUCT(($BR$7:$BR$24=$BR7)*($CB$7:$CB$24>CB7))
BT7:BT24BT7=SUMPRODUCT(($BR$7:$BR$24=$BR7)*($BS$7:$BS$24=$BS7)*($BZ$7:$BZ$24>BZ7))
BU7:BU24BU7=SUMPRODUCT(($BR$7:$BR$24=$BR7)*($BS$7:$BS$24=$BS7)*($BT$7:$BT$24=$BT7)*($CP$7:$CP$24>CP7))
BV7:CC24BV7=CD7+CL7
CD7:CD24CD7=COUNTIF($C$5:$C$346,BQ7)
CE7:CE24CE7=SUMPRODUCT(($C$5:$C$346=BQ7)*($F$5:$F$346>$G$5:$G$346))
CF7:CF24CF7=SUMPRODUCT(($C$5:$C$346=BQ7)*($F$5:$F$346=$G$5:$G$346)*($F$5:$F$346<>""))
CG7:CG24CG7=SUMPRODUCT(($C$5:$C$346=BQ7)*($F$5:$F$346<$G$5:$G$346))
CH7:CH24CH7=SUMIF($C$5:$C$346,BQ7,$F$5:$F$346)
CI7:CI24CI7=SUMIF($C$5:$C$346,BQ7,$G$5:$G$346)
CJ7:CJ24,CR7:CR24CJ7=CH7-CI7
CK7:CK24,CS7:CS24CK7=CE7*3+CF7*1
CL7:CL24CL7=COUNTIF($H$5:$H$346,BQ7)
CM7:CM24CM7=SUMPRODUCT(($H$5:$H$346=BQ7)*($F$5:$F$346<$G$5:$G$346))
CN7:CN24CN7=SUMPRODUCT(($H$5:$H$346=BQ7)*($F$5:$F$346=$G$5:$G$346)*($G$5:$G$346<>""))
CO7:CO24CO7=SUMPRODUCT(($H$5:$H$346=BQ7)*($F$5:$F$346>$G$5:$G$346))
CP7:CP24CP7=SUMIF($H$5:$H$346,BQ7,$G$5:$G$346)
CQ7:CQ24CQ7=SUMIF($H$5:$H$346,BQ7,$F$5:$F$346)
BP7:BP24BP7=SUM(BR7:BU7)
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Peter was referring to the formula he originally posted.
If either Peter's suggestion or mine are not working you need to show what is wrong.
 
Upvote 0
Peter was referring to the formula he originally posted.
If either Peter's suggestion or mine are not working you need to show what is wrong.
I am currently using an Excel version that does not have XL2BB add-on so when I get at home will check and advise what is the problem. Thanks again.
 
Upvote 0
Are these the correct results.
Fluff.xlsm
BQCTCUCVCWCX
5Last 5 games
6Team
7Eintracht FrankfurtLDLDL
8Bayern MunichWWLDW
9WolfsburgLWWDL
10Werder BremenLLWLD
11Union BerlinLDWDL
12Hertha BerlinWLLLL
13BochumLDLDL
14MainzLLWDD
15B. MonchengladbachWLLDW
16HoffenheimWLLDW
17AugsburgWDDLL
18FreiburgLWWWL
19DortmundWDWDW
20Bayer LeverkusenLDWDW
21StuttgartLWDDW
22RB LeipzigWWLWW
23FC KolnWLWDW
24SchalkeWWLWL
Master
Cell Formulas
RangeFormula
CT7:CX24CT7=CHOOSE(SIGN(INDEX($F:$F,AGGREGATE(14,6,ROW($C$5:$C$500)/(($C$5:$C$500=$BQ7)+($H$5:$H$500=$BQ7))/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7)))-INDEX($G:$G,AGGREGATE(14,6,ROW($C$5:$C$500)/(($C$5:$C$500=$BQ7)+($H$5:$H$500=$BQ7))/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7))))*(IF(INDEX($C:$C,AGGREGATE(14,6,ROW($C$5:$C$500)/(($C$5:$C$500=$BQ7)+($H$5:$H$500=$BQ7))/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7)))=$BQ7,1,-1))+2,"L","D","W")
 
Upvote 0
Are these the correct results.
Fluff.xlsm
BQCTCUCVCWCX
5Last 5 games
6Team
7Eintracht FrankfurtLDLDL
8Bayern MunichWWLDW
9WolfsburgLWWDL
10Werder BremenLLWLD
11Union BerlinLDWDL
12Hertha BerlinWLLLL
13BochumLDLDL
14MainzLLWDD
15B. MonchengladbachWLLDW
16HoffenheimWLLDW
17AugsburgWDDLL
18FreiburgLWWWL
19DortmundWDWDW
20Bayer LeverkusenLDWDW
21StuttgartLWDDW
22RB LeipzigWWLWW
23FC KolnWLWDW
24SchalkeWWLWL
Master
Cell Formulas
RangeFormula
CT7:CX24CT7=CHOOSE(SIGN(INDEX($F:$F,AGGREGATE(14,6,ROW($C$5:$C$500)/(($C$5:$C$500=$BQ7)+($H$5:$H$500=$BQ7))/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7)))-INDEX($G:$G,AGGREGATE(14,6,ROW($C$5:$C$500)/(($C$5:$C$500=$BQ7)+($H$5:$H$500=$BQ7))/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7))))*(IF(INDEX($C:$C,AGGREGATE(14,6,ROW($C$5:$C$500)/(($C$5:$C$500=$BQ7)+($H$5:$H$500=$BQ7))/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7)))=$BQ7,1,-1))+2,"L","D","W")

Yes, these above are correct results and the formula this time works fine.


Thank you so much.
 
Upvote 0
How do I need to modify this formula for the last 5 games to show me the last 5 games at home and away like on this table below:

Cell Formulas
RangeFormula
BR7:BR24BR7=RANK(CC7,$CC$7:$CC$24)
BS7:BS24BS7=SUMPRODUCT(($BR$7:$BR$24=$BR7)*($CB$7:$CB$24>CB7))
BT7:BT24BT7=SUMPRODUCT(($BR$7:$BR$24=$BR7)*($BS$7:$BS$24=$BS7)*($BZ$7:$BZ$24>BZ7))
BU7:BU24BU7=SUMPRODUCT(($BR$7:$BR$24=$BR7)*($BS$7:$BS$24=$BS7)*($BT$7:$BT$24=$BT7)*($CP$7:$CP$24>CP7))
BV7:CC24BV7=CD7+CL7
CD7:CD24CD7=COUNTIF($C$5:$C$346,BQ7)
CE7:CE24CE7=SUMPRODUCT(($C$5:$C$346=BQ7)*($F$5:$F$346>$G$5:$G$346))
CF7:CF24CF7=SUMPRODUCT(($C$5:$C$346=BQ7)*($F$5:$F$346=$G$5:$G$346)*($F$5:$F$346<>""))
CG7:CG24CG7=SUMPRODUCT(($C$5:$C$346=BQ7)*($F$5:$F$346<$G$5:$G$346))
CH7:CH24CH7=SUMIF($C$5:$C$346,BQ7,$F$5:$F$346)
CI7:CI24CI7=SUMIF($C$5:$C$346,BQ7,$G$5:$G$346)
CJ7:CJ24,CR7:CR24CJ7=CH7-CI7
CK7:CK24,CS7:CS24CK7=CE7*3+CF7*1
CL7:CL24CL7=COUNTIF($H$5:$H$346,BQ7)
CM7:CM24CM7=SUMPRODUCT(($H$5:$H$346=BQ7)*($F$5:$F$346<$G$5:$G$346))
CN7:CN24CN7=SUMPRODUCT(($H$5:$H$346=BQ7)*($F$5:$F$346=$G$5:$G$346)*($G$5:$G$346<>""))
CO7:CO24CO7=SUMPRODUCT(($H$5:$H$346=BQ7)*($F$5:$F$346>$G$5:$G$346))
CP7:CP24CP7=SUMIF($H$5:$H$346,BQ7,$G$5:$G$346)
CQ7:CQ24CQ7=SUMIF($H$5:$H$346,BQ7,$F$5:$F$346)
BP7:BP24BP7=SUM(BR7:BU7)


Thank you so much in advance.
 
Upvote 0
How about
Fluff.xlsm
BPBQCTCUCVCWCXCYCZDADBDC
5Last 5 games
6RankingTeam
79Eintracht FrankfurtDDDDWWWWWD
81Bayern MunichWDWWWLWLWL
97WolfsburgWDDDDWLWLL
1012Werder BremenLLLLWWLDDW
114Union BerlinDDWWDWLWDW
1218Hertha BerlinWLLDWWWDWW
1317BochumDLLWLWDDLW
148MainzLWDDWWDLDL
1510B. MonchengladbachWLWDDWDDWW
1614HoffenheimWLWWLWDLWW
1713AugsburgWDLDWDWDWW
185FreiburgLWLDWLLDDL
192DortmundWWWWWDDWDL
206Bayer LeverkusenLWWWWDDLLD
2116StuttgartWDLLWWDLWD
223RB LeipzigWWLWWLWLWW
2311FC KolnLDDLLLLLWD
2415SchalkeWWLDWLWWDL
Master
Cell Formulas
RangeFormula
CT7:CX24CT7=CHOOSE(SIGN(INDEX($F:$F,AGGREGATE(14,6,ROW($C$5:$C$500)/($C$5:$C$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7)))-INDEX($G:$G,AGGREGATE(14,6,ROW($C$5:$C$500)/($C$5:$C$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7))))+2,"L","D","W")
CY7:DC24CY7=CHOOSE(SIGN(INDEX($F:$F,AGGREGATE(14,6,ROW($C$5:$C$500)/($H$5:$H$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7)))-INDEX($G:$G,AGGREGATE(14,6,ROW($C$5:$C$500)/($H$5:$H$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7))))+2,"L","D","W")
BP7:BP24BP7=SUM(BR7:BU7)
 
Upvote 0
Ignore the previous post the away games are wrong.
Use
Fluff.xlsm
BPBQCTCUCVCWCXCYCZDADBDC
5Last 5 games
6RankingTeam
79Eintracht FrankfurtDDDDWLLLLD
81Bayern MunichWDWWWWLWLW
97WolfsburgWDDDDLWLWW
1012Werder BremenLLLLWLWDDL
114Union BerlinDDWWDLWLDL
1218Hertha BerlinWLLDWLLDLL
1317BochumDLLWLLDDWL
148MainzLWDDWLDWDW
1510B. MonchengladbachWLWDDLDDLL
1614HoffenheimWLWWLLDWLL
1713AugsburgWDLDWDLDLL
185FreiburgLWLDWWWDDW
192DortmundWWWWWDDLDW
206Bayer LeverkusenLWWWWDDWWD
2116StuttgartWDLLWLDWLD
223RB LeipzigWWLWWWLWLL
2311FC KolnLDDLLWWWLD
2415SchalkeWWLDWWLLDW
Master
Cell Formulas
RangeFormula
CT7:CX24CT7=CHOOSE(SIGN(INDEX($F:$F,AGGREGATE(14,6,ROW($C$5:$C$500)/($C$5:$C$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7)))-INDEX($G:$G,AGGREGATE(14,6,ROW($C$5:$C$500)/($C$5:$C$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7))))+2,"L","D","W")
CY7:DC24CY7=CHOOSE(SIGN(INDEX($G:$G,AGGREGATE(14,6,ROW($C$5:$C$500)/($H$5:$H$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7)))-INDEX($F:$F,AGGREGATE(14,6,ROW($C$5:$C$500)/($H$5:$H$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7))))+2,"L","D","W")
BP7:BP24BP7=SUM(BR7:BU7)
 
Upvote 0
How about
Fluff.xlsm
BPBQCTCUCVCWCXCYCZDADBDC
5Last 5 games
6RankingTeam
79Eintracht FrankfurtDDDDWWWWWD
81Bayern MunichWDWWWLWLWL
97WolfsburgWDDDDWLWLL
1012Werder BremenLLLLWWLDDW
114Union BerlinDDWWDWLWDW
1218Hertha BerlinWLLDWWWDWW
1317BochumDLLWLWDDLW
148MainzLWDDWWDLDL
1510B. MonchengladbachWLWDDWDDWW
1614HoffenheimWLWWLWDLWW
1713AugsburgWDLDWDWDWW
185FreiburgLWLDWLLDDL
192DortmundWWWWWDDWDL
206Bayer LeverkusenLWWWWDDLLD
2116StuttgartWDLLWWDLWD
223RB LeipzigWWLWWLWLWW
2311FC KolnLDDLLLLLWD
2415SchalkeWWLDWLWWDL
Master
Cell Formulas
RangeFormula
CT7:CX24CT7=CHOOSE(SIGN(INDEX($F:$F,AGGREGATE(14,6,ROW($C$5:$C$500)/($C$5:$C$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7)))-INDEX($G:$G,AGGREGATE(14,6,ROW($C$5:$C$500)/($C$5:$C$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7))))+2,"L","D","W")
CY7:DC24CY7=CHOOSE(SIGN(INDEX($F:$F,AGGREGATE(14,6,ROW($C$5:$C$500)/($H$5:$H$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7)))-INDEX($G:$G,AGGREGATE(14,6,ROW($C$5:$C$500)/($H$5:$H$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7))))+2,"L","D","W")
BP7:BP24BP7=SUM(BR7:BU7)

The formula for the home games works fine but for the away games does not work properly. Here is the manual check for the first three teams where highlighted in red are the wrong ones.

Soccer League v2.xlsx
CTCUCVCWCXCYCZDADBDC
5Last 5 games (home)Last 5 games (away)
6
7DDDDWWWWWD
8WDWWWLWLWL
9WDDDDWLWLL
Bunde League
Cell Formulas
RangeFormula
CT7:CX9CT7=CHOOSE(SIGN(INDEX($F:$F,AGGREGATE(14,6,ROW($C$5:$C$500)/($C$5:$C$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7)))-INDEX($G:$G,AGGREGATE(14,6,ROW($C$5:$C$500)/($C$5:$C$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7))))+2,"L","D","W")
CY7:DC9CY7=CHOOSE(SIGN(INDEX($F:$F,AGGREGATE(14,6,ROW($C$5:$C$500)/($H$5:$H$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7)))-INDEX($G:$G,AGGREGATE(14,6,ROW($C$5:$C$500)/($H$5:$H$500=$BQ7)/($F$5:$F$500<>""),COLUMNS($CT$7:CT$7))))+2,"L","D","W")


Thanks.
 
Upvote 0
See post#28, I already realised the error.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,181
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top