+ Reply to Thread
Results 1 to 4 of 4

How to get the number of times exactly 4 consecutive cells have a number greater than 6?

  1. #1
    Registered User
    Join Date
    03-29-2013
    Location
    St Louis
    MS-Off Ver
    Excel 2003
    Posts
    2

    How to get the number of times exactly 4 consecutive cells have a number greater than 6?

    I am wondering how to go about the following problem:
    Say I have a column with the following numbers

    0
    1
    8
    9
    10
    7
    0
    2
    5
    8
    9
    10
    14
    7
    8
    19
    46

    What I want is to go through a long list like this and count the number of times exactly 4 consecutive cells have numbers greater than 6. In this case it will be 1 not 3. It will be 1 for when I want 4 consecutive cells greater than 6 and it will be 1 when I want 8 consecutive cells greater than 6. Hope this makes sense. Any help will be greatly appreciated.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: How to get the number of times exactly 4 consecutive cells have a number greater than

    =SUMPRODUCT(--(FREQUENCY(IF(A1:A17>6, ROW(A1:A17)), IF(A1:A17<=6, ROW(A1:A17)))=4))

    The formula MUST be confirmed with Ctrl+Shift+Enter instead of just Enter.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-29-2013
    Location
    St Louis
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: How to get the number of times exactly 4 consecutive cells have a number greater than

    Thank you very much shg!

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How to get the number of times exactly 4 consecutive cells have a number greater than

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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