+ Reply to Thread
Results 1 to 4 of 4

Count First set of Consecutive Values

  1. #1
    Registered User
    Join Date
    06-25-2007
    Posts
    4

    Count First set of Consecutive Values

    Here is what my row looks like:

    IDLE IDLE IDLE IDLE IDLE DOWN DOWN DOWN IDLE IDLE IDLE QUAL QUAL QUAL


    I need a formula which will look at the first value:

    IDLE IDLE IDLE IDLE IDLE DOWN DOWN DOWN IDLE IDLE IDLE QUAL QUAL QUAL

    'IDLE' in this case. I then need the forumula to count the number of consectutive 'IDLE' values in the first string of consectutive 'IDLE' values.

    IDLE IDLE IDLE IDLE IDLE DOWN DOWN DOWN IDLE IDLE IDLE QUAL QUAL QUAL

    The formula should give me 5 in this case because it took the first value and saw how many times it repeated before hitting the next value of 'DOWN'

    Please let me know if I need to be more clear. Thanks!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Count First set of Consecutive Values

    If your items in are in say, A1:N1, try:

    =COUNTA(A1:INDEX(A1:N1,MATCH(TRUE,INDEX(A1:N1<>A1,0),0)-1))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Count First set of Consecutive Values

    or

    =MATCH(TRUE,INDEX(A1:N1<>A1,0),0)-1

    both the above and NBVC's are open to error of course should all values be the same as that in A1 (ie you might want to validate that first off).

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Count First set of Consecutive Values

    Didn't need that Counta(index(... mumbo jumbo ;(. It didn't click...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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