How to organise data sequentially in groups

excelbeginner344

New Member
Joined
Feb 17, 2020
Messages
3
Office Version
  1. 2013
Platform
  1. Windows
hello,

Just to give a bit of background - i have a college project to do on game states involving football (/ soccer).

I have been given some data and for a season where the home & away goals sit in a binary string of 90 chars. 0= no goal / 1 = goal (the position signifying the minute scored). I have been able to extract the minutes the goals are scored & i have a grid per attached (H S = Home Scored # of goals / A S = Away Scored # of goals).

The difficulty im having is organsing the data into the score sequentially. I need to record the score in order of time (eg 1-0 / 19 minutes, 1-1 / 38 minutes etc)

Its easy where its 0-0, or 1-0, or 0-1. the difficulty im having is to build a picture where there are multiple goals scored.

For example - per the image for Queens Park vs Stoke; i need to reference the code to return the following:

0-1 / 27
0-2 / 31
1-2 / 34
2-2 / 38
3-2 / 71
4-2 / 90

Would be massively grateful if anyone has any ideas. Have tried to use COUNTIF but cant organise it how i need to & have scoured the web but cant see any similar problems that have been solved.

TIA !
 

Attachments

  • scores eg.JPG
    scores eg.JPG
    55.5 KB · Views: 6

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
How about
ZFluff.xlsm
ABCDEFGHIJKLMNOPQRSTUV
1HS1HS2HS3HS4HS5HS6HS7HS8HS9HS10AS1AS2AS3AS4AS5AS6AS7AS8AS9AS10
2
3
434387190273176
5
6
7
8
9270-1 / 27
10310-2 / 31
11341-2 / 34
12382-2 / 38
13713-2 / 71
14763-3 / 76
15904-3 / 90
16  
17
Main
Cell Formulas
RangeFormula
B9:B16B9=IFERROR(AGGREGATE(15,6,$C$4:$V$4/($C$4:$V$4<>""),ROWS(C$9:C9)),"")
C9:C16C9=IF(B9="","",COUNTIF($C$4:$L$4,"<="&B9)&"-"&COUNTIF($M$4:$V$4,"<="&B9)&" / " &B9)
 
Upvote 0
Hi and welcome to MrExcel!

You did not comment on where you want the result or what data you have to perform the search.
With the following array formula, if you put the home and away teams in cells X1 and Y1 you will get the results of those teams in cells X2 down.

Array formulas
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.

varios 17feb2020.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXY
1HomeAwayH S 1H S 2H S 3H S 4H S 5H S 6H S 7H S 8H S 9H S 10A S 1A S 2A S 3A S 4A S 5A S 6A S 7A S 8A S 9A S 10Queens ParkStoke
2NorwLive780-1 / 27
3SoutBurn182600-2 / 31
4MiddLuto171-2 / 34
5WestNott376545902-2 / 38
6ShefRead2172903-2 / 71
7Queens ParkStoke3438719027314-2 / 90
8PresMill78 
sheet
Cell Formulas
RangeFormula
X2:X8X2=IFERROR(COUNTIF(INDEX($C$1:$L$8,MATCH($X$1&"|"&$Y$1,$A$1:$A$8&"|"&$B$1:$B$8,0),0),"<="& SMALL(INDEX($C$1:$V$8,MATCH($X$1&"|"&$Y$1,$A$1:$A$8&"|"&$B$1:$B$8,0),0),ROWS($Y$1:Y1)))&"-"& COUNTIF(INDEX($M$1:$V$8,MATCH($X$1&"|"&$Y$1,$A$1:$A$8&"|"&$B$1:$B$8,0),0),"<="& SMALL(INDEX($C$1:$V$8,MATCH($X$1&"|"&$Y$1,$A$1:$A$8&"|"&$B$1:$B$8,0),0),ROWS($Y$1:Y1)))&" / "& SMALL(INDEX($C$1:$V$8,MATCH($X$1&"|"&$Y$1,$A$1:$A$8&"|"&$B$1:$B$8,0),0),ROWS($Y$1:Y1)),"")
Press CTRL+SHIFT+ENTER to enter array formulas surrounded with curly braces.
 
Upvote 0
cheers for your prompt replys.

fluff - exactly what i am looking for (and i see using countif as well...), but dante you make a v valid point too re the format.

i was hoping to keep this information attached to the row (with the game data). is there anyway to convert the ROWS command to read horizontally ?

i can get it working as you have it set out, but unable to when i try and keep it within the row.

any ideas ?
 

Attachments

  • scores eg2.JPG
    scores eg2.JPG
    70.4 KB · Views: 3
Upvote 0
For the example of your image in post #4 it would be something like this:

varios 17feb2020.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
1HomeAwayH S 1H S 2H S 3H S 4H S 5H S 6H S 7H S 8H S 9H S 10A S 1A S 2A S 3A S 4A S 5A S 6A S 7A S 8A S 9A S 10gl1gl2gl3gl4gl5gl6gl7gl8gl9gl10
2NorwLive7878         
3SoutBurn1826021860       
4MiddLuto1717         
5WestNott3765459037456590      
6ShefRead217290217290       
7Queens ParkStoke343871902731273134387190    
8PresMill          
Hoja2 (2)
Cell Formulas
RangeFormula
W2:AF8W2=IFERROR(SMALL($C2:$V2,COLUMNS($W$1:W$1)),"")
 
Upvote 0
Or if you prefer:

dante amor.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
1HomeAwayH S 1H S 2H S 3H S 4H S 5H S 6H S 7H S 8H S 9H S 10A S 1A S 2A S 3A S 4A S 5A S 6A S 7A S 8A S 9A S 10gl1gl2gl3gl4gl5gl6gl7gl8gl9gl10
2NorwLive780-1 / 78         
3SoutBurn182600-1 / 21-1 / 181-2 / 60       
4MiddLuto170-1 / 17         
5WestNott376545901-0 / 371-1 / 452-1 / 652-2 / 90      
6ShefRead2172900-1 / 210-2 / 720-3 / 90       
7QueeStok3438719027310-1 / 270-2 / 311-2 / 342-2 / 383-2 / 714-2 / 90    
8PresMill          
DAM
Cell Formulas
RangeFormula
W2:AF8W2=IFERROR(COUNTIF($C2:$L2,"<="&SMALL($C2:$V2,COLUMNS($W$1:W$1)))&"-"&COUNTIF($M2:$V2,"<="&SMALL($C2:$V2,COLUMNS($W$1:W$1)))&" / "&SMALL($C2:$V2,COLUMNS($W$1:W$1)),"")
 
Upvote 0
got it. sorry - must've missed the S of columnS when i was trying to transpose it.

excellent - thanks v much both !!
 
Upvote 0
With my way
ZFluff.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAE
1HS1HS2HS3HS4HS5HS6HS7HS8HS9HS10AS1AS2AS3AS4AS5AS6AS7AS8AS9AS10
2
3
4343871902731760-1 / 270-2 / 311-2 / 342-2 / 383-2 / 713-3 / 764-3 / 90  
5
6
Main
Cell Formulas
RangeFormula
W4:AE4W4=IFERROR(COUNTIF($C$4:$L$4,"<="&AGGREGATE(15,6,$C$4:$V$4/($C$4:$V$4<>""),COLUMNS($W4:W4)))&"-"&COUNTIF($M$4:$V$4,"<="&AGGREGATE(15,6,$C$4:$V$4/($C$4:$V$4<>""),COLUMNS($W4:W4)))&" / " &AGGREGATE(15,6,$C$4:$V$4/($C$4:$V$4<>""),COLUMNS($W4:W4)),"")
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,490
Members
448,967
Latest member
visheshkotha

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