+ Reply to Thread
Results 1 to 6 of 6

Count maximum consecutive occurrences in range.

  1. #1
    Registered User
    Join Date
    10-17-2011
    Location
    romania
    MS-Off Ver
    Excel 2010
    Posts
    25

    Count maximum consecutive occurrences in range.

    I want to count the maximum consecutive occurrences inside a range.
    The formula i use now can only search in one column or one row.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Count maximum consecutive occurrences in range.

    Do the columns carry over to the next column? For instance, would a "1" in C19 and a "1" in D4 count as consecutive entries? If the answer is yes, then the formula below appears to be working for me. It should be array entered with Ctrl + Shift + Enter:

    =MAX(FREQUENCY(IF(C4:L19=O3,ROW(C4:L19)+16*(COLUMN(C4:L19)-3)),IF(C4:L19<>O3,ROW(C4:L19)+16*(COLUMN(C4:L19)-3))))
    Attached Files Attached Files
    If your problem has been solved, please use "Thread Tools" to mark the thread as "Solved".

    If you're grateful for this site's existence and would like to contribute to the community, please consider posting something hilarious in our joke thread:
    https://www.excelforum.com/the-water...ke-thread.html

  3. #3
    Registered User
    Join Date
    10-17-2011
    Location
    romania
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Count maximum consecutive occurrences in range.

    Well no, but that should not be a big problem, but if i search for "3" instead of 7 which should be the correct result i get a 3
    Last edited by thusarix; 04-20-2017 at 05:32 PM.

  4. #4
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Count maximum consecutive occurrences in range.

    Maybe I'm misunderstanding the question, then. I only see 3 consecutive threes. Where do you see 7 consecutive threes?

  5. #5
    Registered User
    Join Date
    10-17-2011
    Location
    romania
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Count maximum consecutive occurrences in range.

    Here,
    Your seems to have an extra "3" in D7
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Count maximum consecutive occurrences in range.

    Ah! There are definitely a few differences between the data in my attachment in post #2 and your initial sample. I changed several boxes to test out whether my formula was working properly or not, and I'm not surprised that I didn't switch them all back correctly. I apologize if that created confusion. My intent was that you would try using the formula I came up with in your actual data. Does the formula produce the answer you were expecting when it's used on your actual data?

+ 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: 5
    Last Post: 03-23-2015, 07:06 AM
  2. Replies: 1
    Last Post: 03-20-2015, 03:56 AM
  3. How to find the maximum count of consecutive occurances in an excel range
    By manojsinha2006 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 03-20-2015, 03:47 AM
  4. [SOLVED] Count Consecutive Occurrences
    By dlow in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-17-2014, 12:50 AM
  5. [SOLVED] Count number of occurrences but if there are consecutive matches count them as one
    By michaljireht in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-26-2013, 08:26 PM
  6. Count consecutive number of negative occurrences >=3
    By nbiggss in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-02-2012, 02:14 PM
  7. Count the number of consecutive occurrences
    By timmycl_7 in forum Excel General
    Replies: 12
    Last Post: 05-03-2012, 02:04 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