+ Reply to Thread
Results 1 to 3 of 3

Count of Values (Rows) of Most Recent Consecutive Streak (2+ Distinct Values)

  1. #1
    Registered User
    Join Date
    03-13-2016
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    2

    Question Count of Values (Rows) of Most Recent Consecutive Streak (2+ Distinct Values)

    Hi Everyone,
    I have a column of data that looks like this (assume A1:A9):

    11
    88
    88
    11
    44
    44
    88
    88
    88

    I'm looking for a formula in column B to calculate the count of values (rows) of most recent consecutive streak of a value; i.e. B9 would calculate '3' for 88, '2' for 44 and '1' for 11. My data is chronological in ascending order.

    I've been scratching my head and google searching for the correct combination of Count, Rows, Frequency, etc. functions to get the correct result - but struggling...

    Thanks for any and all effort!

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,148

    Re: Count of Values (Rows) of Most Recent Consecutive Streak (2+ Distinct Values)

    With data starting in row 2

    in B2

    =IF(A2=A1,B1+1,1)

    will give the following results ....


    x y
    11 1
    88 1
    88 2
    11 1
    44 1
    44 2
    88 1
    88 2
    88 3
    44 1
    44 2
    44 3
    44 4


    With the following in D2 down i.e. 11, 44, 88

    then in E2

    =MAX(IF($A$2:$A$14=$D2,$B$2:$B$14))

    Enter above with Ctrl+Shift+Enter

    D E
    11 1
    44 4
    88 3

    Hope this helps.

  3. #3
    Registered User
    Join Date
    03-13-2016
    Location
    Chicago
    MS-Off Ver
    2013
    Posts
    2

    Re: Count of Values (Rows) of Most Recent Consecutive Streak (2+ Distinct Values)

    Hi John,
    Thank you for taking the time to reply to my post!

    Your recommendation has worked for my purposes. I appreciate it!

+ 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. Count number of consecutive days and max streak
    By caubetiep1337 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2016, 03:53 AM
  2. [SOLVED] Count most recent 12 values in a column that are >0 when values are added monthly
    By Phillycheese5 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-03-2014, 04:31 PM
  3. Count Distinct Values
    By trevordsmith in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-02-2014, 09:21 PM
  4. Most recent consecutive streak not including "p"
    By thehoorse in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-13-2013, 09:24 PM
  5. Replies: 2
    Last Post: 10-05-2011, 12:30 PM
  6. Replies: 0
    Last Post: 06-15-2011, 09:46 AM
  7. Count Distinct Values?
    By bill_morgan in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-26-2005, 10:06 PM

Tags for this Thread

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