Summing Largest Consecutive Dollars and Consecutive Average Question

MXL

Board Regular
Joined
Jun 15, 2010
Messages
67
Hello,

I would like to know how i could sum the most consecutive wins in dollars in column A, and the average consecutive wins in column B.

In the table below, you can see in column A1:A3, three consecutive dollar wins which should total $43. How do i go about calculating the largest sum in dollars of consecutive wins which should be $43 because in column A5:A6, there are two consecutive wins that total only $12.

In column B1:B3, three consecutive wins which total 3 and in column B5:B6, two consecutive wins which total 2, how do i go about calculating the average consecutive wins in column B?

AB
1$23Win
2$10Win
3$10Win
4-$42Loss
5$9Win
6$3Win
7-$15Loss

<tbody>
</tbody>

Thank you for taking the time to read this, much appreciated.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Hello

To do this using formulas you will need a couple of helper columns. Please see the image below.

Please note that array formulas must be entered as shown, but before you press Enter or confirm the formula, you need to press the Ctrl, Alt and Enter keys instead - you will know you have done this correctly when curly brackets {} automatically appear around the formula.

Please note this assumes there is a header row and the data starts in row 2. The formulas in columns C and D must be copied down as far as your data goes.

I trust this helps.

ValueWin/LossConsecConsec ValueAverage Consec WinsLongest Consec WinsLongest Consec $Largest Consec $
$23.00Win2.54$42.00$43.00
$10.00Win=AVERAGE(C:C)
$10.00Win3$43.00=MAX(C:C)
-$42.00Loss=INDEX(D:D,MATCH(G2,C:C,0))
$9.00Win=MAX(D:D)
$3.00Win2$12.00
-$15.00Loss
-$10.00Loss
-$5.00Loss
$5.00Win
$10.00Win
$12.00Win
$15.00Win4$42.00
-$5.00Loss
$12.00Win1$12.00
Array Formula in C2: (copy down)
=IF(A2>0,IF(A3>0,"",ROW(A2)-MAX(IF(B$1:B2<>"Win",ROW(B$1:B2)))),"")
Array Formula in D2: (copy down)
=IF(ISNUMBER(C2),SUM(IF(ROW(A$1:A2)>(ROW(A2)-C2),A$1:A2)),"")

<tbody>
</tbody>
 
Last edited:
Upvote 0
Just saw a typo - it's not Ctrl+Alt+Enter to confirm the formula, it is actually Ctrl+Shift+Enter. Once you have entered the array formula into C2 but before you press Enter, instead press Ctrl (hold it) then Shift (also hold that) and then press Enter (and release all 3 at the same time). You will know it has worked when curly brackets {} appear around the formula.

Edit: and repeat for the formula in D2.
 
Last edited:
Upvote 0
@ Andrew Fergus

Longest consecutive $ would require MAXIFS or array-processing:

=MAXIFS(D:D,C:C,G2)

{=MAX(IF(C:C=G2,D:D))}

where G2 = Longest Consec Wins.
 
Upvote 0
Hi Aladain
Thanks for that. I hadn't stipulated G2 contained the number of Longest Consecutive Wins. I noticed all 3 methods return the same value. Why do you not recommend the Index/Match approach? (Am I correct in assuming you are not recommending this?)
Andrew
 
Upvote 0
Hi Aladain
Thanks for that. I hadn't stipulated G2 contained the number of Longest Consecutive Wins. I noticed all 3 methods return the same value. Why do you not recommend the Index/Match approach? (Am I correct in assuming you are not recommending this?)
Andrew

Row\Col
A​
B​
C​
D​
1​
2​
$23
Win
3​
$10
Win
4​
$10
Win
3​
43​
5​
($42)
Loss
6​
$9
Win
7​
$3
Win
8​
$100
win
3​
112​
9​
($15)
Loss
10​

Hi Andrew,

Longest consec $ should be 112 dollars. Index+Match can miss that.

Aladin
 
Upvote 0

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

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