+ Reply to Thread
Results 1 to 10 of 10

Calculate winning or losing streak while ignoring draw

  1. #1
    Registered User
    Join Date
    09-19-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    5

    Calculate winning or losing streak while ignoring draw

    Hi guys,

    In my excel, i tabulated the results of a soccer team, and its Win-Lose-Draw result can be seen in Column H.
    The current results are WWDLL.
    In Cell K2 and L2, i am trying to calculate the latest W/L streak that the team is experiencing.
    The array formula i used, which i found by googling is:

    For win streak
    =MAX(0,MAX((H2:H40="W")*ROW(H2:H40))-MAX((H2:H40="L")*ROW(H2:H40)))
    This gave a result of 0, which is correct since last game result is a "L"

    For lose streak
    =MAX(0,MAX((H2:H40="L")*ROW(H2:H40))-MAX((H2:H40="W")*ROW(H2:H40)))
    This gave a result of 3, which is WRONG, as i have only 2 L

    Is there anyway to calculate W or L, while treating D as "invisible"?
    The formula i am looking for is to ignore D. This means if there is a result of WLDLL, the Lose streak should show 3.

    Thanks in advance, i tried googling and looking through the forum, there are some similar posts regarding streaks, but they are all different from this case.

    Appreciate your help.
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate winning or losing streak while ignoring draw

    Hi stensten. Welcome to the forum.

    Try array entering this in K2. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Use the same logic for the other cells.
    Dave

  3. #3
    Registered User
    Join Date
    09-19-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    5

    Re: Calculate winning or losing streak while ignoring draw

    Quote Originally Posted by FlameRetired View Post
    Hi stensten. Welcome to the forum.

    Try array entering this in K2. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Use the same logic for the other cells.
    Hi FlameRetired,

    Thanks so much for your help! I entered the array formula and i got the following result:

    For Win streak: 2
    For Lose streak: 2

    I am sorry if i did not make my post clear, i am looking for the latest streak while ignoring "D".

    So my desired result is

    Win streak:0
    Lose streak: 2

    As the result (from first to last) is WWDLL. The latest streak for this team is 2 Losses.

    If next game is a W, and result becomes WWDLLW, the latest streak i am looking for is 1 Win and Losses will be 0.

    Hope you can help me further with this, sorry for the confusion!

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate winning or losing streak while ignoring draw

    Try array entering this in K2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and this in L2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I might be able to come up with something simpler if the dates in column A are always in ascending order. Are they?

  5. #5
    Registered User
    Join Date
    09-19-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    5

    Re: Calculate winning or losing streak while ignoring draw

    Hi FlameRetired,

    Sorry for the late reply, due to time difference.

    Yes the dates in column A are always in ascending order.

    Your new formula solved part of the problem. Current result is WWDLL

    So your formula correctly pointed out the latest streak as 2.

    However if i add on to the result, assuming it becomes WWDLLDLL, my desired result is 4 losses, ignoring the Ds in between. Your formula gives the answer of 2, i guess because it is interrupted by the D. Any way to overcome this?

    I tried another way. which is to make the D result a blank instead. So the cells will become WW LL.
    In another column, i use a formula to remove the blanks. Result will become WWLL.
    Then i can use calculate the streak.
    However, i am still struggling to comprehend the formula which removes the blanks. the formula i found on the internet is (assuming data is in A2 to A9)
    =IFERROR(INDEX($A$2:$A$10,SMALL(IF(ISTEXT($A$2:$A$10),ROW($A$1:$A$9),""),ROW(A1))),"")

    Thanks for the help, really appreciate it.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate winning or losing streak while ignoring draw

    However if i add on to the result, assuming it becomes WWDLLDLL, my desired result is 4 losses, ignoring the Ds in between. Your formula gives the answer of 2, i guess because it is interrupted by the D. Any way to overcome this?
    This changes things. Will have to do a re-think.

  7. #7
    Registered User
    Join Date
    09-19-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    5

    Re: Calculate winning or losing streak while ignoring draw

    Quote Originally Posted by FlameRetired View Post
    This changes things. Will have to do a re-think.
    Hi FlameRetired,

    Thanks, you have been a great help.

    I managed to use formula to set "D" to blank (displaying as 0) in Column H. In Column J, have a formula to remove the blanks.
    For Column I, same thing. For result that is "Pushed", i set it to blank. And in Column K, the formula removes the blanks in between.

    However, now there seems to be a problem with the formula in N2, O2, P2 and Q2.

    Purely looking at Column J and Column K, we can see there are 4 Ws and 4 Under. Why does the formula in N2 and Q2 gives result of 5??

    Thanks,
    stensten
    Attached Files Attached Files

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate winning or losing streak while ignoring draw

    I have not done a painstaking look at your new approach. What little I did see seems to work.

    In the meantime I was working on this.

    There is a dynamic named range in Name Manager. I named it Handicap. It's formula is
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    You can follow the logic of that dynamic named range to create one for Under/Over.

    Then in J3:K3 there are two helper cells. The formula in J3 and filled across is
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then array enter this formula in L3 and fill across to M3.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Again follow the same logic to build your formula in N3:O3.

  9. #9
    Registered User
    Join Date
    09-19-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    5

    Re: Calculate winning or losing streak while ignoring draw

    Hi FlameRetired,

    Thanks so much!

    I know your formula works to perfection.. trying to understand and do the same for N3:O3...

    update:
    I think i got it!
    Works like a charm... thanks so much for your help!
    Last edited by stensten; 09-20-2017 at 02:31 AM. Reason: update

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate winning or losing streak while ignoring draw

    You're welcome. Thanks for the feedback and marking this thread Solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Calculating team winning-losing streak
    By lastdroidkiller in forum Excel Formulas & Functions
    Replies: 46
    Last Post: 05-15-2018, 11:50 AM
  2. [SOLVED] Winning streak.....
    By jackf-nc in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-07-2016, 11:37 AM
  3. [SOLVED] winning streak....
    By jackf-nc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2016, 11:37 AM
  4. winning/losing streak without dates in order
    By chemmiah in forum Excel General
    Replies: 3
    Last Post: 01-28-2011, 11:57 PM
  5. Replies: 4
    Last Post: 08-21-2010, 09:09 PM
  6. Calculating Longest winning and losing streak.
    By Lewis Koh in forum Excel General
    Replies: 2
    Last Post: 07-27-2009, 08:43 AM
  7. identify greatest winning and losing streak
    By atlus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-10-2009, 01:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1