football Recent Form

bonezvillefc

New Member
Joined
Feb 28, 2022
Messages
6
Office Version
  1. 2016
Platform
  1. Windows
My excel workbook scrape results from Betstudy.com (VBA). I was able to create league table from the results for all the games played this season. I am looking for a formula to generate the last 5 and 10 games played by each team both at home and away. Also my results sheet scrape postponed games (appearing as Pstp in a column) and my league table recognize these postponed games as played games. I would like another formula to ignore these games. Help for this will be highly appreciated

Betstudy Form Guide v1.6 - Copy - Copy.xlsb
ABCDEFGHIJKLMNOPQRSTUVWX
1DateHome TeamAway TeamHome GoalsAway GoalsTeamsHome GoalsColumn2Column3Column4URL:https://www.betstudy.com/soccer-stats/c/spain/copa-del-rey/d/results/2021-2022/
227.02.2022West Ham UnitedWolverhampton Wanderers10West Ham United252146Under 2.5URL List
327.02.2022ChelseaLeicester CityPstpWolverhampton Wanderers101424#VALUE!England - 2021/2022 Championship results
426.02.2022EvertonManchester City01Chelsea272249Under 2.5South Africa - 2021/2022 PSL results
526.02.2022Brighton & Hove AlbionAston Villa02Leicester City211637Under 2.5England - 2021/2022 Premier League results
626.02.2022Manchester UnitedWatford00Everton181028Under 2.5LeagueEng PLSpain - 2021/2022 Primera División results
726.02.2022Crystal PalaceBurnley11Manchester City362864Under 2.5Germany - 2021/2022 Bundesliga results
826.02.2022BrentfordNewcastle United02Brighton & Hove Albion101525Under 2.5Italy - 2021/2022 Serie A results
926.02.2022Leeds UnitedTottenham Hotspur04Aston Villa201333over2.5https://www.betstudy.com/soccer-stats/c/france/ligue-1/results/2021-2022/
1025.02.2022SouthamptonNorwich City20Manchester United212344Under 2.5Portugal - 2021/2022 Primeira Liga results
1124.02.2022ArsenalWolverhampton Wanderers21Watford121325over2.5USA - 2022 MLS results
1223.02.2022LiverpoolLeeds United60Crystal Palace221537over2.5Sweden - 2022 Allsvenskan results
1323.02.2022WatfordCrystal Palace14-3Burnley101222over2.5Brazil - 2022 Serie A results
1423.02.2022BurnleyTottenham Hotspur101Brentford141327Under 2.5https://www.betstudy.com/soccer-stats/c/denmark/superliga/d/results/2021-2022/
1520.02.2022Wolverhampton WanderersLeicester City211Newcastle United181028over2.5France - 2021/2022 Ligue 2 results
1620.02.2022Leeds UnitedManchester United24-2Leeds United151429over2.5Netherlands - 2021/2022 Eredivisie results
1719.02.2022Manchester CityTottenham Hotspur23-1Tottenham Hotspur181735over2.5Netherlands - 2021/2022 Eerste Divisie results
1819.02.2022SouthamptonEverton202Southampton181634Under 2.5Italy - 2021/2022 Serie B results
1919.02.2022LiverpoolNorwich City312Norwich City8715over2.5Spain - 2021/2022 Primera División results
2019.02.2022Crystal PalaceChelsea01-1Arsenal221638Under 2.5Israel - 2021/2022 Ligat ha'Al results
2119.02.2022Brighton & Hove AlbionBurnley03-3Liverpool363470over2.5Turkey - 2021/2022 Süper Lig results
2219.02.2022Aston VillaWatford01-1000Under 2.5
2319.02.2022ArsenalBrentford211000over2.5League List
2419.02.2022West Ham UnitedNewcastle United110000Under 2.5Eng Championship
2515.02.2022Manchester UnitedBrighton & Hove Albion202000Under 2.5Eng PL
2613.02.2022Leicester CityWest Ham United220381329710over2.5SA PSL
2713.02.2022Tottenham HotspurWolverhampton Wanderers02-2Under 2.5Spain Primera
2813.02.2022Newcastle UnitedAston Villa101Under 2.5Germany Bundesliga
2913.02.2022BurnleyLiverpool01-1Under 2.5Italy Serie A
3012.02.2022Norwich CityManchester City04-4over2.5Fra Ligue
3112.02.2022WatfordBrighton & Hove Albion02-2Under 2.5Portugal Primeira
3212.02.2022EvertonLeeds United303over2.5USA MLS
3312.02.2022ChelseaArsenalPstp#VALUE!#VALUE!Sweden
3412.02.2022BrentfordCrystal Palace000Under 2.5Brazil Serie
3512.02.2022Manchester UnitedSouthampton110Under 2.5Spain Laliga
3610.02.2022LiverpoolLeicester City202Under 2.5Denmark Superliga
3710.02.2022Wolverhampton WanderersArsenal01-1Under 2.5Fra Ligue2
3809.02.2022Aston VillaLeeds United330over2.5Ned Eredivisie
3909.02.2022Manchester CityBrentford202Under 2.5Ned Eerste
4009.02.2022Tottenham HotspurSouthampton23-1over2.5Italy Serie B
4109.02.2022Norwich CityCrystal Palace110Under 2.5Spain Liga2
4208.02.2022BurnleyManchester United110Under 2.5Israel Ligat
4308.02.2022Newcastle UnitedEverton312over2.5Turkey Super
4408.02.2022West Ham UnitedWatford101Under 2.5
4505.02.2022BurnleyWatford000Under 2.5
4623.01.2022ChelseaTottenham Hotspur202Under 2.5
4723.01.2022Leicester CityBrighton & Hove Albion110Under 2.5
4823.01.2022Crystal PalaceLiverpool13-2over2.5
4923.01.2022ArsenalBurnley000Under 2.5
5022.01.2022SouthamptonManchester City110Under 2.5
5122.01.2022Manchester UnitedWest Ham United101Under 2.5
5222.01.2022Leeds UnitedNewcastle United01-1Under 2.5
5322.01.2022BrentfordWolverhampton Wanderers12-1over2.5
5422.01.2022EvertonAston Villa01-1Under 2.5
5521.01.2022WatfordNorwich City03-3over2.5
5619.01.2022BrentfordManchester United13-2over2.5
5719.01.2022Leicester CityTottenham Hotspur23-1over2.5
5818.01.2022Brighton & Hove AlbionChelsea110Under 2.5
5916.01.2022Tottenham HotspurArsenalPstp#VALUE!#VALUE!
6016.01.2022West Ham UnitedLeeds United23-1over2.5
6116.01.2022LiverpoolBrentford303over2.5
6215.01.2022Aston VillaManchester United220over2.5
6315.01.2022Wolverhampton WanderersSouthampton312over2.5
6415.01.2022Norwich CityEverton211over2.5
6515.01.2022Newcastle UnitedWatford110Under 2.5
6615.01.2022Manchester CityChelsea101Under 2.5
6714.01.2022Brighton & Hove AlbionCrystal Palace110Under 2.5
6812.01.2022West Ham UnitedNorwich City202Under 2.5
6911.01.2022EvertonLeicester CityPstp#VALUE!#VALUE!
7011.01.2022SouthamptonBrentford413over2.5
7103.01.2022Manchester UnitedWolverhampton Wanderers01-1Under 2.5
7202.01.2022ChelseaLiverpool220over2.5
7302.01.2022Leeds UnitedBurnley312over2.5
7402.01.2022EvertonBrighton & Hove Albion23-1over2.5
7502.01.2022BrentfordAston Villa211over2.5
7601.01.2022Crystal PalaceWest Ham United23-1over2.5
7701.01.2022WatfordTottenham Hotspur01-1Under 2.5
7801.01.2022Leicester CityNorwich CityPstp#VALUE!#VALUE!
7901.01.2022ArsenalManchester City12-1over2.5
8030.12.2021Manchester UnitedBurnley312over2.5
8129.12.2021BrentfordManchester City01-1Under 2.5
8229.12.2021ChelseaBrighton & Hove Albion110Under 2.5
8328.12.2021Leicester CityLiverpool101Under 2.5
8428.12.2021WatfordWest Ham United14-3over2.5
8528.12.2021SouthamptonTottenham Hotspur110Under 2.5
8628.12.2021Crystal PalaceNorwich City303over2.5
8727.12.2021Newcastle UnitedManchester United110Under 2.5
8826.12.2021Brighton & Hove AlbionBrentford202Under 2.5
8926.12.2021Aston VillaChelsea13-2over2.5
9026.12.2021West Ham UnitedSouthampton23-1over2.5
9126.12.2021Tottenham HotspurCrystal Palace303over2.5
9226.12.2021Norwich CityArsenal05-5over2.5
9326.12.2021Manchester CityLeicester City633over2.5
9426.12.2021BurnleyEvertonPstp#VALUE!#VALUE!
9519.12.2021Tottenham HotspurLiverpool220over2.5
9619.12.2021Wolverhampton WanderersChelsea000Under 2.5
9719.12.2021Newcastle UnitedManchester City04-4over2.5
9818.12.2021Leeds UnitedArsenal14-3over2.5
9918.12.2021Aston VillaBurnleyPstp#VALUE!#VALUE!
10016.12.2021LiverpoolNewcastle United312over2.5
RESULTS
Cell Formulas
RangeFormula
H2:H25H2=SUMIF($B$2:$B$600,$G2,$D$2:$D$600)
I2:I25I2=SUMIF($C$2:$C$600,$G2,$E$2:$E$600)
J2:J25J2=SUM(RESULTS!$H2:$I2)
H26H26=SUBTOTAL(109,RESULTS!$H$2:$H$25)
I26I26=SUBTOTAL(109,RESULTS!$I$2:$I$25)
J26J26=SUBTOTAL(109,RESULTS!$J$2:$J$25)
F13:F100F13=D13-E13
K2:K100K2=IF(D2+E2>=3,"over2.5","Under 2.5")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B:BCell Valuecontains "metz"textNO
B:BCell Valuecontains "udinese"textNO
C:CCell Valuecontains "sALERNITANA"textNO
Cells with Data Validation
CellAllowCriteria
M6List=$P$24:$P$43
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Column F: IF(AND(D2<>"Pstp",E2<>"Pstp"),D2-E2,"Ptsp")
Column K: IF(AND(D2<>"Pstp",E2<>"Pstp"),IF(D2+E2>=3,"over2.5","Under 2.5"),"Ptsp")

Just adding in a condition for postponement. I used not-postponed because you are more likely to have a game not be postponed, and a good practice is to have your most likely event be the true statement since it's called first (fewer steps in the processing).
 
Upvote 0
Nice one..it worked. Still have to take care of column B C D & E as it is recognized as a game played in my league table
as of now Chelsea played 12 games @ home and this season 2 matches were postponed so my table show that it played 14 games instead of 12
..and because scraping shows Pstp instead of score the table takes it as a loss, so totaling 3 losses . Chelsea only lost 1 game this season at home

yet Thanks for the formulas, they working super fine so far

Hopefully i can work around them to come up with other solutions
 

Attachments

  • Capture.PNG
    Capture.PNG
    30.3 KB · Views: 19
Upvote 0
Do you have an XL2BB for me of that sheet?
For the "Played" column I would use

COUNTIFS(Results!B2:B100, REFERENCE TO CELL WITH TEAM NAME, Results!D2:D100, "<>Pstp") + COUNTIFS(Results!C2:C100, REFERENCE TO CELL WITH TEAM NAME, Results!D2:D100, "<>Pstp")

If you are getting your losses from "Played" - ("W" + "D") then this should fix both in one. Else please post you XL2BB.
 
Upvote 0
Looks like it could work. fixed chelsea but messed up other teams' games

Cell Formulas
RangeFormula
C3:C26C3=COUNTIFS(RESULTS!$B$2:$B$552,CALCULATIONS!A3,RESULTS!$D$2:$D$552,"<>Pstp")
D3:D26D3=COUNTIFS(RESULTS!$B$2:$B$552,CALCULATIONS!A3,RESULTS!$F$2:$F$552,">0")
E3:E26E3=COUNTIFS(RESULTS!$B$2:$B$552,CALCULATIONS!A3,RESULTS!$F$2:$F$552,0)
O3:O26,F3:F26F3=C3-D3-E3
G3:G26G3=SUMIFS(RESULTS!$D$2:$D$552,RESULTS!$B$2:$B$552,CALCULATIONS!A3)
H3:H26H3=SUMIFS(RESULTS!$E$2:$E$552,RESULTS!$B$2:$B$552,CALCULATIONS!A3)
R3:R26,I3:I26I3=D3*3+E3*1
S3:S26,J3:J26J3=G3-H3
L3:L26L3=COUNTIFS(RESULTS!$C$2:$C$552,A3,RESULTS!$D$2:$D$552,"<>Ptsp")
M3:M26M3=COUNTIFS(RESULTS!$C$2:$C$552,CALCULATIONS!A3,RESULTS!$F$2:$F$552,"<0")
N3:N26N3=COUNTIFS(RESULTS!$C$2:$C$552,CALCULATIONS!A3,RESULTS!$F$2:$F$552,0)
P3:P26P3=SUMIFS(RESULTS!$E$2:$E$552,RESULTS!$C$2:$C$552,CALCULATIONS!A3)
Q3:Q26Q3=SUMIFS(RESULTS!$D$2:$D$552,RESULTS!$C$2:$C$552,CALCULATIONS!A3)
A3:A26A3=RESULTS!G2




Betstudy Form Guide v1.6 - Copy - Copy.xlsb
ABCDEFGHIJKLMNO
1DateHome TeamAway TeamHome GoalsAway GoalsGDTeamsHome GoalsColumn2Column3Column4URL:https://www.betstudy.com/soccer-stats/c/spain/copa-del-rey/d/results/2021-2022/
227.02.2022West Ham UnitedWolverhampton Wanderers101West Ham United252146Under 2.5
327.02.2022ChelseaLeicester CityPstpPtspWolverhampton Wanderers101424Ptsp
426.02.2022EvertonManchester City01-1Chelsea272249Under 2.5
526.02.2022Brighton & Hove AlbionAston Villa02-2Leicester City211637Under 2.5
626.02.2022Manchester UnitedWatford000Everton181028Under 2.5LeagueEng PL
726.02.2022Crystal PalaceBurnley110Manchester City362864Under 2.5
826.02.2022BrentfordNewcastle United02-2Brighton & Hove Albion101525Under 2.5
926.02.2022Leeds UnitedTottenham Hotspur04-4Aston Villa201333over2.5
1025.02.2022SouthamptonNorwich City202Manchester United212344Under 2.5
1124.02.2022ArsenalWolverhampton Wanderers211Watford121325over2.5
1223.02.2022LiverpoolLeeds United606Crystal Palace221537over2.5
1323.02.2022WatfordCrystal Palace14-3Burnley101222over2.5
1423.02.2022BurnleyTottenham Hotspur101Brentford141327Under 2.5
1520.02.2022Wolverhampton WanderersLeicester City211Newcastle United181028over2.5
1620.02.2022Leeds UnitedManchester United24-2Leeds United151429over2.5
1719.02.2022Manchester CityTottenham Hotspur23-1Tottenham Hotspur181735over2.5
1819.02.2022SouthamptonEverton202Southampton181634Under 2.5
1919.02.2022LiverpoolNorwich City312Norwich City8715over2.5
2019.02.2022Crystal PalaceChelsea01-1Arsenal221638Under 2.5
2119.02.2022Brighton & Hove AlbionBurnley03-3Liverpool363470over2.5
2219.02.2022Aston VillaWatford01-1000Under 2.5
2319.02.2022ArsenalBrentford211000over2.5
2419.02.2022West Ham UnitedNewcastle United110000Under 2.5
2515.02.2022Manchester UnitedBrighton & Hove Albion202000Under 2.5
2613.02.2022Leicester CityWest Ham United220381329710over2.5
2713.02.2022Tottenham HotspurWolverhampton Wanderers02-2Under 2.5
2813.02.2022Newcastle UnitedAston Villa101Under 2.5
2913.02.2022BurnleyLiverpool01-1Under 2.5
3012.02.2022Norwich CityManchester City04-4over2.5
3112.02.2022WatfordBrighton & Hove Albion02-2Under 2.5
3212.02.2022EvertonLeeds United303over2.5
3312.02.2022ChelseaArsenalPstpPtspPtsp
RESULTS
Cell Formulas
RangeFormula
H2:H25H2=SUMIF($B$2:$B$600,$G2,$D$2:$D$600)
I2:I25I2=SUMIF($C$2:$C$600,$G2,$E$2:$E$600)
J2:J25J2=SUM(RESULTS!$H2:$I2)
H26H26=SUBTOTAL(109,RESULTS!$H$2:$H$25)
I26I26=SUBTOTAL(109,RESULTS!$I$2:$I$25)
J26J26=SUBTOTAL(109,RESULTS!$J$2:$J$25)
F2:F33F2= IF(AND(D2<>"Pstp",E2<>"Pstp"),D2-E2,"Ptsp")
K2:K33K2=IF(AND(D2<>"Pstp",E2<>"Pstp"),IF(D2+E2>=3,"over2.5","Under 2.5"),"Ptsp")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B:BCell Valuecontains "metz"textNO
B:BCell Valuecontains "udinese"textNO
C:CCell Valuecontains "sALERNITANA"textNO
Cells with Data Validation
CellAllowCriteria
M6List=$P$24:$P$43
 
Upvote 0
It all looks to be in working order. Check on RESULTS that all instances of "Watford" and "Burnley" are spelled correctly, have the same capitalization, and do not have extra spaces or characters.
 
Upvote 0
It all looks to be in working order. Check on RESULTS that all instances of "Watford" and "Burnley" are spelled correctly, have the same capitalization, and do not have extra spaces or characters.
I dont think there is a spelling problem cause everything comes from the web. nothing was entered manually
 
Upvote 0
I don't have YOUR data set in YOUR sheets with ALL of YOUR formulas, so I'm not entirely sure where the issue is coming from.
That being said, if it were me, I would set up filters on RESULTS, filter for only one team for Home Team, look to find any data that would cause an issue, move on to the next team until all teams are done, them move on to Away Team doing the same thing. It can be a long process of problem solving, but it might be necessary.
 
Upvote 0
I don't have YOUR data set in YOUR sheets with ALL of YOUR formulas, so I'm not entirely sure where the issue is coming from.
That being said, if it were me, I would set up filters on RESULTS, filter for only one team for Home Team, look to find any data that would cause an issue, move on to the next team until all teams are done, them move on to Away Team doing the same thing. It can be a long process of problem solving, but it might be necessary.
how do i send the data set and all formulars...i am new here
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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