+ Reply to Thread
Results 1 to 5 of 5

Complicated COUNTIF on a filtered array

  1. #1
    Forum Contributor
    Join Date
    08-04-2013
    Location
    Bucharest
    MS-Off Ver
    Office Professional Plus 2019
    Posts
    303

    Complicated COUNTIF on a filtered array

    This may be a lot to ask, but I need to at least know if this is doable.
    First of all the formula should only count the visible cells because the data is affected by auto-filter "by surface"

    COUNTIF L2:L5000 = either "2-1" or "1-2" more than 4 times in a row, and if so, how many times

    To clarify, any of the two values will count, it can be "1-2", then" 2-1", then "1-2", then "2-1", and it will count as a series of 4.

    If it can be done but not on auto-filtered data, then I must be able to apply another condition, that the formula should count only if the "Surface" is "hard".
    Thanks
    Attached Files Attached Files
    Last edited by bibu; 03-15-2014 at 06:00 AM.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Complicated COUNTIF on a filtered array

    With an pivot table.

    Sheet the result in the attached file.

    Please reply.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Contributor
    Join Date
    08-04-2013
    Location
    Bucharest
    MS-Off Ver
    Office Professional Plus 2019
    Posts
    303

    Re: Complicated COUNTIF on a filtered array

    Thank you for taking the time to answer.
    Unfortunately I don't think I explained properly what I need.
    The answer I need is : the maximum number of consecutive instances where the L (set score) cell is "2-1" or "1-2", or in other words, the maximum number of consecutive matches where has Annika Beck played 3 sets (2-1 or 1-2 means she played 3 sets in the respective match).
    I know nothing about pivot tables so I don't know how to modify it to get the answer I want.
    Thanks again!
    Last edited by bibu; 03-15-2014 at 11:14 AM.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Complicated COUNTIF on a filtered array

    To count how many runs of 4+ there are you can use this "array formula"

    =SUM(IF(FREQUENCY(IF((L$2:L$300="2-1")+(L$2:L$300="1-2"),IF(F$2:F$300="Hard",ROW(F$2:F$300))),IF(L$2:L$300<>"2-1",IF(L$2:L$300<>"1-2",IF(F$2:F$300="Hard",ROW(F$2:F$300)))))>=4,1))

    confirmed with CTRL+SHIFT+ENTER

    The formula only considers hard surface matches - easier to do that than consider only visible data

    For your data as it stands that formula will return zero because there are no runs > 3. I suggest you manually create some longer runs to test the formula
    Audere est facere

  5. #5
    Forum Contributor
    Join Date
    08-04-2013
    Location
    Bucharest
    MS-Off Ver
    Office Professional Plus 2019
    Posts
    303

    Re: Complicated COUNTIF on a filtered array

    Thanks, I was thinking about an array, but I was on the wrong track, you mentioned a few days ago, something about OFFSET creating an array but it seemed very complicated that way..
    I'll test it and reply!
    Edit: Awesome, it seems to be working!!! Many thanks! I guess now I'll spend the rest of the day analyzing your formula.
    Last edited by bibu; 03-15-2014 at 11:32 AM.

+ 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. [SOLVED] Complicated IF and COUNTIF for a bakery spreadsheet
    By twigdip in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 08-08-2013, 11:37 AM
  2. complicated countif
    By vchibisov in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-30-2012, 10:45 AM
  3. Complicated COUNTIF function
    By Avinit in forum Excel General
    Replies: 6
    Last Post: 02-01-2012, 04:56 PM
  4. [SOLVED] complicated array
    By boris in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-01-2005, 07:06 AM
  5. Replies: 0
    Last Post: 02-03-2005, 02:06 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