+ Reply to Thread
Results 1 to 5 of 5

Countif divided by count with filter

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    Tacoma, Washington
    MS-Off Ver
    Excel 2007
    Posts
    3

    Countif divided by count with filter

    Hello, I need assistance with a countif/count with a filter. I have searched and found part of the answer but it doesn't seem to be working for me. I am looking to get a percentage of accurracy for the period(s) that are filtered.

    This is my initial formula which works but not after the filter which is by period in column A.
    =(COUNTIF(G5:G21,1)/COUNT(G5:G21))

    After adding the sumproduct that I came across I don't get the results I am expecting. Most of the threads I have read are looking for a string character and not a number, not sure if that is why it is not working or not.

    This is one of many variations of formulas I found and tried to make work in my sheet by changing the cell references. I guess I am missing something, maybe just a DUH moment. I did try to make the "1" be 1 and that gave me 16 without filter which should actually be 1 or if percentage 100 when it is "1" it gives me 0.
    =SUMPRODUCT(SUBTOTAL(3,OFFSET(G5:G21,ROW(G5:G21)-MIN(ROW(G5:G21)),,1))*(G5:G21="1"))

    Any help is appreciated and thank you for your time.
    Krise

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Countif divided by count with filter

    Care to post a small workbook showing some sample data, and manual mockups of the results you're trying to formulate after applying a filter?

    Click GO ADVANCED and use the paperclip icon to post up your sample workbook.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Countif divided by count with filter

    hi Krise, welcome to the forum. when you put double quotes for "1", you are looking for a text. your formula gives you 16 because you only did the COUNTIF portion. you still have to divide by the COUNT. so:
    =SUMPRODUCT(SUBTOTAL(3,OFFSET(G5,ROW(G5:G21)-MIN(ROW(G5:G21)),,1))*(G5:G21=1))/SUBTOTAL(2,G5:G21)
    Last edited by benishiryo; 03-19-2013 at 10:19 PM. Reason: spotted mistake

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Registered User
    Join Date
    03-19-2013
    Location
    Tacoma, Washington
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Countif divided by count with filter

    was waiting for approval to share the data...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-19-2013
    Location
    Tacoma, Washington
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Countif divided by count with filter

    benishiryo, that worked perfectly...thank you both for your responses.

+ 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