Formula/macro to count the number of continuous wins and losses for each subject/team

smide

Board Regular
Joined
Dec 20, 2015
Messages
162
Office Version
  1. 2016
Platform
  1. Windows
Hello.


In columns A and B (A2:B400) I have a list of all games in one season, home team is in column A and away team in column B. Columns C and D shows game outcome Win or Loss (W/L).


I need a formula (or VBA) to count the number of current win/loss streaks after each game and to place those results in columns E and F. If team is in column A (home team) result (number of consecutive W/L) should be placed in column E, if team is in column B (away team) result should be placed in column F.
* Consecutive number of losses is represented with negative number.
* Two possible game outcomes: Win or Loss (W or L).


example. (only for Team1 here)

ABCDEF
1Home TeamAway TeamGame outcome homeGame outcome awayConsecutive home W/LConsecutive away W/L
2Team1WL1
3Team1LW2
4
5Team1LW-1
6
7
8Team1LW-2
9
10Team1WL-3

<tbody>
</tbody>


explanation. Team1 won first two games so result in cell F3 after second game is 2, then they lost next three games and result in cell F10 is -3.
 
Last edited:

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,214,907
Messages
6,122,181
Members
449,071
Latest member
cdnMech

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