+ Reply to Thread
Results 1 to 4 of 4

Thread: COUNTIF until the result is greater than or equal to a specified number.

  1. #1
    Registered User
    Join Date
    01-03-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    COUNTIF until the result is greater than or equal to a specified number.

    I have a data set that has long rows of cells that contain any number between 1-5. I need to locate the first occurence in each row whereby the number "2" occurs, but only when the following 17 adjacent cells also contain the number 2 (to make a total of 18 consecutive 1's in a row). I have been very stuck on this. Any help would be greatly appreciated!

    I have attached a sample of the type of data I am looking at.

    Cheers,

    JSB
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    01-03-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: COUNTIF until the result is greater than or equal to a specified number.

    Quote Originally Posted by JSB_2011 View Post
    (to make a total of 18 consecutive 1's in a row)

    This is supposed to say "to make a total of 18 consecutive 2's in a row.

    Sorry for the confusion

    JSB

  3. #3
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: COUNTIF until the result is greater than or equal to a specified number.

    Perhaps:

    AHS2:
    =MIN(IF(COUNTIF(OFFSET($B2,0,COLUMN($B2:$AGZ2)-COLUMN($B2),1,18),2)=18,$B$1:$AGZ$1))
    confirmed with CTRL + SHIFT + ENTER
    copied down to AHS33
    Note array entry requirement. If Array has been confirmed correctly the above formula will appear encased within { } [these can not be added manually]

  4. #4
    Registered User
    Join Date
    01-03-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: COUNTIF until the result is greater than or equal to a specified number.

    Hey,

    Look good. Thanks heaps!
    J

+ 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.2.0