Hi all.
I'm looking for some code or a formula that will solve the following issue that I have.
This is to work out all the combinations regarding the order of goals scored within a football match. Basically the H means Home Team and the A means Away team.
The requirement is to get all the possible combinations regarding the order the goals are scored.
So for
1-0 the only combination is H
2-0 the only combination is HH
2-1 the combinations are HHA, HAH, AHH
3-0 the only combination is HHH
3-1 the combinations are HHHA, HHAH, HAHH, AHHH
So the above gives an idea of what i'm looking for.
In the 3-1 example the results are broken down as follows
HHHA The home team scores the first 3 goals and then the away team scores the last goal of the match
HHAH The home team scores the first 2 goals of the match, the away team then scores 1 and then the home team scores the last goal of the match
HAHH The home teams scores the first goal of the match, the away team then score the 2nd goal of the match, then the home team go on and score the 3rd and the 4th goal of the match
AHHH The away team score the first goal of the match, then the home team score the next 3 goals
All the above combinations result in a 3-1 result, however the goals could be scored in any of the above orders.
Below are 3 screenshots showing the whole sheet. As you can see when the scores get to 9-8, there will be many possible combinations in regards to the order of the goals, hence the need for a macro or formula to calculate these.
In an ideal world, a formula / macro would populate each possible outcome starting in column D for the corresponding row, so for our 3-1 example and all the scores above, the first screenshot below shows the desired outcome, with all the combinations shown in red.
Below shows the full sheet.
I hope this all makes sense and isn't too difficult.
Thanks
Mark
I'm looking for some code or a formula that will solve the following issue that I have.
This is to work out all the combinations regarding the order of goals scored within a football match. Basically the H means Home Team and the A means Away team.
The requirement is to get all the possible combinations regarding the order the goals are scored.
So for
1-0 the only combination is H
2-0 the only combination is HH
2-1 the combinations are HHA, HAH, AHH
3-0 the only combination is HHH
3-1 the combinations are HHHA, HHAH, HAHH, AHHH
So the above gives an idea of what i'm looking for.
In the 3-1 example the results are broken down as follows
HHHA The home team scores the first 3 goals and then the away team scores the last goal of the match
HHAH The home team scores the first 2 goals of the match, the away team then scores 1 and then the home team scores the last goal of the match
HAHH The home teams scores the first goal of the match, the away team then score the 2nd goal of the match, then the home team go on and score the 3rd and the 4th goal of the match
AHHH The away team score the first goal of the match, then the home team score the next 3 goals
All the above combinations result in a 3-1 result, however the goals could be scored in any of the above orders.
Below are 3 screenshots showing the whole sheet. As you can see when the scores get to 9-8, there will be many possible combinations in regards to the order of the goals, hence the need for a macro or formula to calculate these.
In an ideal world, a formula / macro would populate each possible outcome starting in column D for the corresponding row, so for our 3-1 example and all the scores above, the first screenshot below shows the desired outcome, with all the combinations shown in red.
Below shows the full sheet.
I hope this all makes sense and isn't too difficult.
Thanks
Mark