Consecutive points scored basketball

SubZero55

New Member
Joined
Dec 27, 2020
Messages
10
Office Version
  1. 365
Platform
  1. Windows
Hi,

I was kindly given a solution to this problem but in trying to apply it to a larger dataset am getting some errors.

So I am seeking the most consecutive points scored by each team in Basketball games. The solution for game 1 should be 9 for Away (from 60-95 to 9-95) and 11 for Home (49-69 to 49-80)

Thanks if anyone is able to help me here.

Cheers


Book1
ABC
11Game IDAway ScoreHome Score
12100
13100
14100
15100
16110
17120
18122
19142
20145
21145
22145
23147
24147
25147
261410
271410
281410
291410
301410
311610
321610
331610
341610
351610
361610
371610
381610
391610
401612
411612
421613
431613
441713
451813
461813
471813
481813
491813
501816
511816
521816
531816
541816
551816
561816
571818
581818
591818
601818
611818
621820
631820
641820
651820
661820
671820
681920
691923
701923
711923
721923
731923
741923
751923
761923
771923
781923
791923
8011123
8111126
8211326
8311328
8411328
8511328
8611328
8711328
8811328
8911328
9011328
9111328
9211328
9311328
9411328
9511328
9611528
9711528
9811728
9911728
10011728
10111728
10211728
10311728
10411728
10511728
10611729
10711730
10811730
10911733
11011733
11111736
11211736
11311736
11411736
11511736
11611736
11711736
11811736
11911736
12011736
12111736
12211736
12311736
12411736
12511736
12611736
12711737
12811738
12911938
13011940
13112240
13212240
13312240
13412540
13512540
13612540
13712540
13812540
13912540
14012540
14112540
14212540
14312542
14412542
14512542
14612542
14712542
14812542
14912544
15012544
15112544
15212544
15312644
15412644
15512644
15612844
15712844
15812844
15912844
16012844
16112844
16212844
16312844
16413044
16513044
16613044
16713044
16813044
16913047
17013047
17113047
17213047
17313047
17413047
17513048
17613048
17713048
17813048
17913049
18013049
18113049
18213050
18313050
18413050
18513050
18613050
18713050
18813050
18913050
19013050
19113050
19213050
19313050
19413050
19513050
19613050
19713050
19813050
19913050
20013050
20113050
20213050
20313050
20413050
20513050
20613050
20713350
20813350
20913350
21013350
21113350
21213350
21313350
21413350
21513550
21613550
21713550
21813552
21913552
22013552
22113552
22213552
22313552
22413554
22513754
22613754
22713754
22813754
22913754
23013754
23113756
23213756
23313756
23413956
23513958
23613958
23713958
23813958
23913958
24014258
24114258
24214258
24314258
24414258
24514258
24614258
24714258
24814258
24914258
25014258
25114258
25214258
25314258
25414258
25514258
25614258
25714258
25814258
25914260
26014260
26114260
26214260
26314360
26414360
26514360
26614560
26714563
26814563
26914563
27014563
27114563
27214563
27314563
27414565
27514565
27614565
27714565
27814566
27914567
28014567
28114567
28214567
28314568
28414569
28514569
28614569
28714769
28814769
28914769
29014869
29114969
29214969
29314969
29414969
29514969
29614971
29714971
29814971
29914972
30014973
30114973
30214973
30314973
30414975
30514975
30614975
30714975
30814975
30914975
31014977
31114977
31214977
31314977
31414977
31514977
31614977
31714977
31814977
31914977
32014977
32114977
32214977
32314977
32414980
32514980
32614980
32715280
32815280
32915280
33015480
33115480
33215482
33315682
33415682
33515682
33615684
33715684
33815784
33915784
34015784
34115784
34215784
34315784
34415884
34515884
34615885
34715886
34815886
34915886
35015886
35115886
35215886
35315887
35415887
35515887
35616087
35716089
35816089
35916089
36016090
36116090
36216090
36316090
36416090
36516090
36616091
36716092
36816092
36916092
37016092
37116092
37216092
37316095
37416295
37516295
37616295
37716295
37816295
37916295
38016295
38116295
38216295
38316495
38416495
38516695
38616695
38716695
38816695
38916995
39016995
39116995
39216995
39316998
39416998
39516998
39616999
39716999
39816999
39917199
40017199
40117199
40217199
40317199
40417199
40517199
406171101
407171101
408171101
409171101
410173101
411173101
412173101
413173103
414173103
415173104
416173104
417173104
418173104
419173104
420173104
421173104
422173104
423173104
424174104
425175104
426175104
427175104
428175104
429175104
430175104
431175104
432175104
433175104
434175104
435175104
436177104
437177107
438177107
439177107
440177109
441177109
442177109
443177109
444177109
445177109
446177110
447177110
448177110
449177110
450177111
451177111
452177111
453177111
454177111
455177111
456177111
457178111
458178111
459178111
460178111
461178111
462178111
463178111
464178111
465178111
466178111
467178112
468178112
469178112
470178113
471178113
472178113
473178116
474178116
475178116
476178116
477178116
478181116
479181116
480181116
481183116
482183116
483183116
484183116
485183116
486183116
487184116
488184116
489184116
490184116
491184118
492187118
493187118
494189118
495189118
496189118
497191118
498191118
499191118
500191118
501191118
502191120
503194120
504194120
505194120
506194120
507194120
508196120
509196120
510196120
511196120
512196120
513196123
514196123
515196123
516196123
517196123
518196125
519196125
520196125
521196125
522196125
523196125
524196125
525196125
526196125
527199125
528199125
529200
530200
531200
532200
533220
534220
535220
536250
537250
538250
539250
540250
541250
542250
543250
544253
545273
546273
547283
548285
549285
5502115
5512115
5522115
5532115
5542115
5552115
5562145
5572145
5582145
5592165
5602165
5612165
5622165
5632165
5642165
5652165
5662165
5672165
5682168
5692168
5702178
5712178
5722178
5732178
5742188
5752188
5762188
5772188
5782188
5792188
5802218
58122110
58222110
58322110
58422110
58522110
58622110
58722110
58822110
58922110
59022110
59122110
59222210
59322212
59422212
59522212
59622412
59722412
59822414
59922414
60022414
60122414
60222414
60322415
60422415
60522515
60622615
60722615
60822915
60922915
61022915
61122915
61223115
61323115
61423115
61523315
61623315
61723316
61823316
61923317
62023517
62123517
62223517
62323717
62423717
62523917
62623917
62723917
62823917
62923917
63023917
63123917
63223919
63323919
63423919
63523919
63623919
63723919
63823919
63923919
64023919
64123919
64223919
64323919
64423919
64523919
64623919
64723919
64823920
64923920
65023920
65123920
65224120
65324120
65424120
65524120
65624120
65724120
65824120
65924120
66024120
66124120
66224120
66324120
66424120
66524120
66624120
66724120
66824120
66924120
67024120
67124120
67224120
67324120
67424123
67524123
67624123
67724123
67824123
67924123
68024123
68124123
68224123
68324123
68424123
68524123
68624123
68724123
68824123
68924123
69024123
69124123
69224123
69324123
69424123
69524125
69624125
69724125
69824125
69924125
70024125
70124125
70224125
70324125
70424125
70524125
70624125
70724125
70824125
70924126
71024127
71124127
71224127
71324130
71424130
71524130
71624130
71724130
71824330
71924330
72024430
72124430
72224431
72324432
72424432
72524432
72624434
72724434
72824434
72924435
73024435
73124435
73224435
73324435
73424735
73524735
73624736
73724736
73824736
73924737
74024937
74124939
74225139
74325139
74425139
74525139
74625139
74725139
74825141
74925141
75025141
75125143
75225343
75325346
75425346
75525346
75625346
75725346
75825346
75925346
76025346
76125346
76225347
76325347
76425348
76525348
76625348
76725350
76825650
76925650
77025650
77125650
77225651
77325651
77425651
77525654
77625653
77725654
77825653
77925654
78025654
78125654
78225654
78325654
78425654
78525654
78625654
78725654
78825654
78925654
79025654
79125654
79225954
79325954
79425954
79526154
79626156
79726356
79826359
79926359
80026359
80126361
80226361
80326361
80426361
80526561
80626563
80726863
80826865
80926865
81026965
81126965
81226965
81326965
81426965
81526965
81626965
81726965
81826968
81926968
82026968
82127168
82227168
82327168
82427168
82527168
82627168
82727168
82827168
82927168
83027168
83127168
83227168
83327168
83427168
83527168
83627168
83727170
83827170
83927170
84027170
84127170
84227470
84327472
84427472
84527472
84627472
84727473
84827473
84927473
85027473
85127473
85227473
85327573
85427575
85527575
85627775
85727775
85827775
85927775
86027775
86127775
86227775
86327775
86427775
86527775
86627775
86727775
86827775
86927775
87027775
87127775
87227775
87327775
87427775
87527775
87627775
87727775
87827775
87927775
88027775
88127775
88227775
88327775
88427775
88527775
88627775
88727775
88827776
88927976
89027976
89128176
89228176
89328176
89428276
89528276
89628276
89728278
89828478
89928478
90028478
90128778
90228778
90328778
90428778
90528978
90628978
90728978
90828978
90928978
91028978
91128980
91229180
91329180
91429180
91529180
91629180
91729180
91829180
91929180
92029182
92129182
92229182
92329185
92429185
92529185
92629485
92729488
92829488
92929588
93029688
93129688
93229688
93329688
93429689
93529690
93629990
93729990
93829990
93929990
94029990
94129990
94229990
94329990
94429991
94529991
94629992
94729992
94829992
94929992
95029992
95129992
95229992
95329992
954210192
955210192
956210192
957210192
958210192
959210192
960210492
961210492
962210592
963210594
964210794
965210794
966210794
967210794
968210794
969210794
970210794
971210794
972210794
973210794
974210794
975210994
976210994
977210994
978210994
979210994
980210994
981210994
982210994
983211194
984211196
985211196
986211196
987211196
988211296
989211296
990211296
991211296
992211296
993211296
994211296
995211296
996211296
997211296
998211296
999211296
1000211296
Sheet1
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
This formula here - =LET(Fltr,FILTER($B$12:$C$1972,($A$12:$A$1972=A3)*($B$12:$B$1972>0)),Most,(FILTER(INDEX(Fltr,,1),INDEX(Fltr,,2)=MODE.SNGL(INDEX(Fltr,,2)))),MAX(Most)-MIN(Most))

Ive copied across from the sample sheet where it works - but have made some error in the transfer.

Like most Excel things I am sure there are alternate solutions but struggling to find one here!
 
Upvote 0
This formula here - =LET(Fltr,FILTER($B$12:$C$1972,($A$12:$A$1972=A3)*($B$12:$B$1972>0)),Most,(FILTER(INDEX(Fltr,,1),INDEX(Fltr,,2)=MODE.SNGL(INDEX(Fltr,,2)))),MAX(Most)-MIN(Most))

Ive copied across from the sample sheet where it works - but have made some error in the transfer.

Like most Excel things I am sure there are alternate solutions but struggling to find one here!
my excel doesn't have filter function so can't help on that one, sorry.
 
Upvote 0
my excel doesn't have filter function so can't help on that one, sorry.
Thanks anyway ORSM...

Ha your username reminds me of one of my all time favourite clips...

David Tua, a heavyweight boxer from New Zealand was on their Celebrity Wheel of Fortune.. and asked for an O for Orsum (how he felt Awesome was spelt).... not even allowed to choose vowels in the game!

 
Upvote 0
How about
Excel Formula:
=MAX(MAXIFS(B12:B2000,A12:A2000,A3,C12:C2000,SEQUENCE(200))-MINIFS(B12:B2000,A12:A2000,A3,C12:C2000,SEQUENCE(200)))
=MAX(MAXIFS(C12:C2000,A12:A2000,A3,B12:B2000,SEQUENCE(200))-MINIFS(C12:C2000,A12:A2000,A3,B12:B2000,SEQUENCE(200)))
 
Upvote 0
Just for kicks, here is a Power Query version.

unique.xlsx
ABCDEFG
1Game IDAway ScoreHome ScoreGame IDAwayHome
21001119
31002109
4100
5100
6110
7120
8122
9142
10145
11145
12145
13147
14147
15147
161410
171410
181410
191410
201410
211610
221610
23
Sheet6


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Type = Table.TransformColumnTypes(Source,{{"Game ID", Int64.Type}, {"Away Score", Int64.Type}, {"Home Score", Int64.Type}}),
    GroupAway = Table.Group(Type, {"Game ID"}, {{"Away", each _, type table}}),
    gAway = Table.TransformColumns(GroupAway,{{"Away", each Table.Group(_,{"Away Score"},{{"Count", each _, type table}})}}),
    difAway = Table.TransformColumns(gAway,{{"Away",(tbl)=> Table.Max(Table.TransformColumns(tbl,{{"Count", each Table.Max(_,"Home Score")[Home Score]-Table.Min(_,"Home Score")[Home Score]}}),"Count")[Count]}}),
    GroupHome = Table.Group(Type, {"Game ID"}, {{"Home", each _, type table}}),
    gHome = Table.TransformColumns(GroupHome,{{"Home", each Table.Group(_,{"Home Score"},{{"Count", each _, type table}})}}),
    difHome = Table.TransformColumns(gHome,{{"Home",(tbl)=> Table.Max(Table.TransformColumns(tbl,{{"Count", each Table.Max(_,"Away Score")[Away Score]-Table.Min(_,"Away Score")[Away Score]}}),"Count")[Count]}}),
    Merge = Table.NestedJoin(difAway,{"Game ID"},difHome,{"Game ID"},"difHome",JoinKind.LeftOuter),
    Expand = Table.ExpandTableColumn(Merge, "difHome", {"Home"}, {"Home"})
in
    Expand
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,259
Members
452,626
Latest member
huntinghunter

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