+ Reply to Thread
Results 1 to 11 of 11

Counting streaks in Excel

  1. #1
    Registered User
    Join Date
    12-19-2013
    Location
    United Kingdom
    MS-Off Ver
    2010
    Posts
    13

    Counting streaks in Excel

    Hello,

    I'm currently using this formula =MAX(FREQUENCY(IF(C:C>8,ROW(C:C)),IF(C:C<=8,ROW(C:C)))) to count streaks where column C is higher than 8.

    In column A I have a list of team names that have received the scores - its in a random order.

    Is it possible to count streaks where scores are above 8 for certain names in column A?

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Counting streaks in Excel

    May you provide a sample workbook - I am not sure what it is that you require? Your formula does not count streaks but return the longest streak.

  3. #3
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Counting streaks in Excel

    Have you tried sumproduct.

    Let us assume that your team name is in column A and scored in column B.

    We want to know the streaks for team1 , which is entered in cell d1

    the formula in e2 would be

    Please Login or Register  to view this content.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Counting streaks in Excel

    @xlbiznes that wouldn't count streaks just everything >8 for a given team
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Counting streaks in Excel

    Quote Originally Posted by Danielpeam View Post

    In column A I have a list of team names that have received the scores - its in a random order.

    Is it possible to count streaks where scores are above 8 for certain names in column A?
    The names would have to be sorted or grouped together.

    For example:


    Data Range
    A
    B
    C
    D
    E
    1
    Name
    Score
    -----
    Name
    Consecutives
    2
    Bill
    1
    Bill
    3
    3
    Bill
    8
    4
    Bill
    8
    5
    Bill
    8
    6
    Bill
    5
    7
    Karen
    2
    8
    Karen
    8
    9
    Karen
    8
    10
    Karen
    2


    This array formula** entered in E2:

    =MAX(FREQUENCY(IF(A2:A10=D2,IF(B2:B10=8,ROW(B2:B10))),IF(A2:A10<>D2,IF(B2:B10<>8,ROW(B2:B10)))))



    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    12-19-2013
    Location
    United Kingdom
    MS-Off Ver
    2010
    Posts
    13

    Re: Counting streaks in Excel

    Thats perfect! Thanks everyone for the help and sorry the explanation wasn't great.


    Quote Originally Posted by Tony Valko View Post
    The names would have to be sorted or grouped together.

    For example:


    Data Range
    A
    B
    C
    D
    E
    1
    Name
    Score
    -----
    Name
    Consecutives
    2
    Bill
    1
    Bill
    3
    3
    Bill
    8
    4
    Bill
    8
    5
    Bill
    8
    6
    Bill
    5
    7
    Karen
    2
    8
    Karen
    8
    9
    Karen
    8
    10
    Karen
    2


    This array formula** entered in E2:

    =MAX(FREQUENCY(IF(A2:A10=D2,IF(B2:B10=8,ROW(B2:B10))),IF(A2:A10<>D2,IF(B2:B10<>8,ROW(B2:B10)))))



    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Counting streaks in Excel

    You're welcome. Thanks for the feedback!

    If your question has been answered please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools>Mark this thread as solved.

  8. #8
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Counting streaks in Excel

    @Tony Valko,

    i got that wrong.

  9. #9
    Registered User
    Join Date
    06-30-2016
    Location
    Stoke, England
    MS-Off Ver
    10
    Posts
    2

    Re: Counting streaks in Excel

    Hi, wondering if anyone can help having some issues with this formula

    Using the previous example with Bill and Karen's scores.

    But say Bill got another score of 8 and this was added to the data(A11,B11), in E2 it would no longer show 3, it would show 4... Counting how many 8s Bill got, not what the streak of 8s was.

    Im curious because in the spreadsheet I wish to use this in, all of the name info is the same, so the formula is just counting how many times the required outcome occurs not what the longest streak is.

    Do I need a different formula or is there a simple change that can be made to this one?

    Thanks

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Counting streaks in Excel

    Forum ownership doesn't want people to post questions in someone else's thread.

    Please start your own thread.

  11. #11
    Registered User
    Join Date
    06-30-2016
    Location
    Stoke, England
    MS-Off Ver
    10
    Posts
    2
    ahh no worries didn't realise, sorted it now anyway

+ 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. Exclude zero when counting streaks (win/loss) and current streaks
    By poko10 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-11-2013, 06:06 AM
  2. Replies: 6
    Last Post: 02-04-2012, 06:57 PM
  3. Excel 2007 : How do I count streaks in excel 2007?
    By Santoryuu in forum Excel General
    Replies: 4
    Last Post: 11-07-2011, 05:53 PM
  4. Replies: 0
    Last Post: 09-27-2011, 10:31 AM
  5. Streaks
    By Jaymond Flurrie in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-21-2006, 02:59 PM

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