+ Reply to Thread
Results 1 to 4 of 4

Need the Count of cells only if they occur consecutively

  1. #1
    Registered User
    Join Date
    11-12-2015
    Location
    Colorado
    MS-Off Ver
    2010
    Posts
    10

    Need the Count of cells only if they occur consecutively

    I need to get the total of the cells only if the "U" occurs consecutively 6 or more times. For instance:

    U U U U U U U U P P U U U U U U P U U U P P

    In the line above, there are a total of 17 "U"s, but I only need the sum of the ones that occur consecutively 6 or more times, so in this case, the value would be 14.

    I am using:
    =SUMPRODUCT(--(FREQUENCY(IF(H19:AD19="U",COLUMN(H19:AD19)),IF(H19:AD19<>"U",COLUMN(H19:AD19)))>=6))

    to identify that the 6+ consecutive times happens 2 times, but now need the count of those cells.

    Thank you

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

    Re: Need the Count of cells only if they occur consecutively

    Try this array formula**:

    =SUM(IF(FREQUENCY(IF(H19:AD19="U",COLUMN(H19:AD19)),IF(H19:AD19<>"U",COLUMN(H19:AD19)))>=6,FREQUENCY(IF(H19:AD19="U",COLUMN(H19:AD19)),IF(H19:AD19<>"U",COLUMN(H19:AD19)))))

    ** 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.

  3. #3
    Registered User
    Join Date
    11-12-2015
    Location
    Colorado
    MS-Off Ver
    2010
    Posts
    10

    Re: Need the Count of cells only if they occur consecutively

    Great! That worked!

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

    Re: Need the Count of cells only if they occur consecutively

    You're welcome. Thanks for the feedback!


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

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as 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. Replies: 10
    Last Post: 10-09-2014, 08:06 PM
  2. [SOLVED] Count how often multiple number values occur by using functions
    By joefitness in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-29-2014, 12:21 AM
  3. Replies: 8
    Last Post: 07-14-2013, 07:29 PM
  4. Count number a times a specific value appears consecutively.
    By kww0027 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-03-2013, 06:17 PM
  5. How to use xml to count numbers that occur in roulette
    By SilentShad0w in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-25-2009, 03:49 PM
  6. Count when values occur in different arrays
    By smileyc in forum Excel General
    Replies: 6
    Last Post: 02-26-2009, 07:56 AM
  7. Replies: 6
    Last Post: 02-14-2008, 09:58 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