+ Reply to Thread
Results 1 to 6 of 6

Embed COUNTIF in SUBTOTAL with multiple criteria

  1. #1
    Registered User
    Join Date
    05-04-2011
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2007
    Posts
    27

    Embed COUNTIF in SUBTOTAL with multiple criteria

    I have two worksheets in the same workbook. One (Calc!) shows an analysis of the data in the other (Records!). I am trying to create a chart in Calc! showing the breakdown of the data in Records!. I was initially using a COUNTIFS function, but I needed it to ignore filtered rows.

    Ultimately, I need it to return a count of visible rows with a number in "Column A" larger than Calc!$C$7 AND a number between 50 and 100 in "Column B". I have five different ranges to show separate calculations, so that's why I just can't filter them both.

    I've used the following for the $C$7 calculation, which works, but when I try to add any calculation for column B in the same formula or separate, it does not work and returns an "N/A#". I'm using...
    =SUMPRODUCT(SUBTOTAL(2,OFFSET(Records!$A$2:$A$100000,ROW(Records!$A$2:$A$100000)-ROW(Records!$A$2),0,1)),--(Records!$A$2:$A$100000>=$C$7))

    In my amateur Excel world it would be something like:
    =SUBTOTAL(Records!$A:$A,>=$C$7)-SUBTOTALS(Records!$B:$B,>50,<=101)

    Help!
    Last edited by 2Excel; 05-04-2011 at 12:33 PM.

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

    Re: Embed COUNTIF in SUBTOTAL with multiple criteria

    Does this work?

    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
    Registered User
    Join Date
    05-04-2011
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Embed COUNTIF in SUBTOTAL with multiple criteria

    It works all the way up to the >=$C$7, but then it produces the same #N/A error. So I think It has something to do with asking it to reference column B in Records!

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

    Re: Embed COUNTIF in SUBTOTAL with multiple criteria

    Does column B have errors in it?

    or can you post sample condensed workbook?

  5. #5
    Registered User
    Join Date
    05-04-2011
    Location
    Fort Worth, Texas
    MS-Off Ver
    Excel 2007
    Posts
    27

    Re: Embed COUNTIF in SUBTOTAL with multiple criteria

    Perfect!!! I plugged in a error check and...wah lah! I had one lonely error amid a sea of 45,000 records. Thank you!

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

    Re: Embed COUNTIF in SUBTOTAL with multiple criteria

    Great,

    If you are satisfied with the solution provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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