+ Reply to Thread
Results 1 to 5 of 5

SubTotal Count(2)

  1. #1
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    SubTotal Count(2)

    Hi,
    I a formula in one of my cells so that when the data is filtered it will add up all the cells that have a yes in them. However I'm getting an error. If I use the countif formula it still adds all the cells with yes that are not in the filter selection.

    So can someone help me with the correct formula to use when I filter my data?

    Here is the problem
    Please Login or Register  to view this content.
    This works fine but wont work with the filter on it still counts all the "Yes".
    Please Login or Register  to view this content.
    Thank You, Mike
    Last edited by realniceguy5000; 01-15-2009 at 12:48 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    TRY:

    Please Login or Register  to view this content.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492
    You can't pass a parameter "Yes" to the SUBTOTAL(2, formula. But if you filter by that column showing only YES answers, your Subtotal formula will instantly tell you how many are cells are visible.

    So, don't think of the formula as count='yes' and just think of it as count='visible'

    Now, you can do it this way:

    =SUMPRODUCT(SUBTOTAL(3,OFFSET(G6:G6000,ROW(G6:G6000)
    -MIN(ROW(G6:G6000)),,1)), --(G6:G6000="Yes"))


    (Source)
    Last edited by JBeaucaire; 01-15-2009 at 12:22 PM.
    _________________
    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!)

  4. #4
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951
    Outstanding. Guys It's Working now.

    It would have taking some time if ever for me to get that formula working on my own. I tried both options.

    I didn't have any luck with nbvc I kept getting 0 as the anwser,however you got me thinking in the right direction. Thank You

    JB your formula worked... Thank You

    Thanks Again for the help, Mike

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by realniceguy5000 View Post
    Outstanding. Guys It's Working now.

    It would have taking some time if ever for me to get that formula working on my own. I tried both options.

    I didn't have any luck with nbvc I kept getting 0 as the anwser,however you got me thinking in the right direction. Thank You

    JB your formula worked... Thank You

    Thanks Again for the help, Mike
    That is because you really wanted the COUNTA() function (i.e. 3) instead of the COUNT() function (i.e. 2) as you had originally implied.

+ 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