+ Reply to Thread
Results 1 to 2 of 2

Apply COUNTIF to visible cells in a range

  1. #1
    Registered User
    Join Date
    03-26-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    11

    Question Apply COUNTIF to visible cells in a range

    Hello,

    I am trying to apply a COUNTIF function to only visible cells in a selected range. Here's the regular COUNTIF formula that I'm working with.

    =COUNTIF(INDEX(TABLE1,0,MATCH($B8,TABLE1[#Headers],0)),VLOOKUP(18,$AF$7:$AG$28,2,FALSE))

    Column B in the current sheet contains dates, which are also present in the header row in TABLE1. This countif formula does the following:

    1) Uses INDEX(TABLE1,0,MATCH($B8,TABLE1[#Headers],0)) to define the range as the column in TABLE1 with a header that matches the date in $B8.
    2) Uses VLOOKUP(18,$AF$7:$AG$28,2,FALSE) to define the search term through a VLOOKUP of a small table in the current sheet.

    The formula works just fine. However, I'm unsure of how to get it to ignore hidden rows. I know that you can do this with simpler functions using SUBTOTAL, and I have a VBA solution that works but is extremely slow. Any ideas?

    Thanks for your help.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Apply COUNTIF to visible cells in a range

    HI Belthasar,

    Look into Subtotal function to work on visible cells.


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

+ 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