+ Reply to Thread
Results 1 to 6 of 6

Finding Maximum count of consecutive occurrances of a text from an range in excel.

  1. #1
    Registered User
    Join Date
    03-20-2015
    Location
    Bangalore
    MS-Off Ver
    Microsoft Office 2007
    Posts
    5

    Finding Maximum count of consecutive occurrances of a text from an range in excel.

    Hi,

    Can we have a formula for finding the maximum count in an excel range? For e.g If an employee has consecutively worked more than 6 days, then it should return 1 or else it should return 0.

    In the below e.g. Let's assume that an employee has been present consecutively for 9 days. In this case the formula should return 1.

    1-Mar 2-Mar 3-Mar 4-Mar 5-Mar 6-Mar 7-Mar 8-Mar 9-Mar 10-Mar 11-Mar 12-Mar 13-Mar 14-Mar 15-Mar 16-Mar 17-Mar 18-Mar
    Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed Thu Fri Sat Sun Mon Tue Wed
    WO P P P WO P P P P P P P P P WO P P P

    Your help would be much appreciated.

    Thank you!

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Finding Maximum count of consecutive occurrances of a text from an range in excel.

    Hi.

    Array formula**:

    =N(MAX(FREQUENCY(IF(A3:R3="P",COLUMN(A3:R3)),IF(A3:R3<>"P",COLUMN(A3:R3))))>6)

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    03-20-2015
    Location
    Bangalore
    MS-Off Ver
    Microsoft Office 2007
    Posts
    5

    Re: Finding Maximum count of consecutive occurrances of a text from an range in excel.

    Thanks a lot. It worked out perfectly. :-)

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Finding Maximum count of consecutive occurrances of a text from an range in excel.

    You're welcome!

  5. #5
    Registered User
    Join Date
    03-20-2015
    Location
    Bangalore
    MS-Off Ver
    Microsoft Office 2007
    Posts
    5

    Re: Finding Maximum count of consecutive occurrances of a text from an range in excel.

    Hi,

    Will it be also possible to find out the total number of times these consecutive occurances has occurred in that range if it greater than 6?

    In the below example this should return the value of 3. Since, the employee was present consequetively for more than 6 days three times.

    WO P P P WO P P P P P P P WO P P P P P P P P WO P P P P P P P

    Sorry for bothering you too much.

    Thank you!

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Finding Maximum count of consecutive occurrances of a text from an range in excel.

    No bother at all:

    =SUM(N(FREQUENCY(IF(A3:AC3="P",COLUMN(A3:AC3)),IF(A3:AC3<>"P",COLUMN(A3:AC3)))>6))

    Regards

+ 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: 1
    Last Post: 03-20-2015, 03:56 AM
  2. 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
  3. Count the maximum consecutive TRUEs
    By tomgilb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-07-2011, 12:23 AM
  4. Replies: 4
    Last Post: 11-30-2010, 05:14 PM
  5. Finding the maximum occurrence of text over non-consecutive cells
    By raehippychick in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-15-2009, 09:04 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