+ Reply to Thread
Results 1 to 4 of 4

Counting consecutive values less than X

  1. #1
    Registered User
    Join Date
    01-15-2014
    Location
    Bulacan, Philippines
    MS-Off Ver
    Excel 2010
    Posts
    4

    Counting consecutive values less than X

    Well, my question is in the title.

    For example
    There are five values: 2,4,6,8,9 in which I want to count the number of consecutive rows with values less than 5 and the function would return the value 2.

    So if the values are 2 3 3 3 3 6 3 ,it would only return the value 5 because the last "3" is interrupted by a 6.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Counting consecutive values less than X

    welcome to the forum. say your values are in column A:G, try this array formula say in J1:
    =MAX(FREQUENCY(IF(A1:G1>0,IF(A1:G1<5,COLUMN(A1:G1))),IF(A1:G1>=5,COLUMN(A1:G1))))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Counting consecutive values less than X

    Hi stellards,

    See if this works for you.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    01-15-2014
    Location
    Bulacan, Philippines
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Counting consecutive values less than X

    Thank you very much!
    Reputation added to benishiryo and MarvinP

+ 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. Counting same values in consecutive columns
    By santhoosan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-11-2013, 03:48 AM
  2. Counting Consecutive values and saving them
    By tdrouillard in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-11-2013, 10:23 PM
  3. [SOLVED] Counting Consecutive Values
    By khauskins in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-24-2012, 11:37 AM
  4. Counting consecutive values
    By Elijah in forum Excel General
    Replies: 7
    Last Post: 04-23-2010, 05:13 PM
  5. Counting consecutive non-zero values
    By RichH6109 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-26-2007, 07:21 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