+ Reply to Thread
Results 1 to 7 of 7

Countif only visible cells

  1. #1
    Forum Contributor
    Join Date
    08-19-2009
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    585

    Countif only visible cells

    Hi all,

    Is it possible to Countif only visible cells?
    Rows are continually hidden and made visible again, but the range is constant.

    btw. I don't like to use a filter in this layout.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Countif only visible cells

    Chip has a UDF for visible cells at this page

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Countif only visible cells

    see SUBTOTAL ... if you're not using AutoFilter then see the 101+ functions.

    If you want to conduct conditional calcs then you need to either

    a) embed the SUBTOTAL within an OFFSET within a SUMPRODUCT

    b) use a Visible Flag in a column at source (eg a SUBTOTAL COUNTA per row which will return 1 (visible) or 0 (not visible))
    then you might consider using a SUMIF if single condition eg SUMIF(criteriacolumn,criteria,subtotalcountacolumn)
    Last edited by DonkeyOte; 10-30-2010 at 03:57 AM.

  4. #4
    Forum Contributor
    Join Date
    08-19-2009
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    585

    Re: Countif only visible cells

    Quote Originally Posted by arthurbr View Post
    Chip has a UDF for visible cells at this page
    Thanks for the link Arthur, bit it doesn't address the countif function

  5. #5
    Forum Contributor
    Join Date
    08-19-2009
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    585

    Re: Countif only visible cells

    Quote Originally Posted by DonkeyOte View Post
    see SUBTOTAL ... if you're not using AutoFilter then see the 101+ functions.

    If you want to conduct conditional calcs then you need to either

    a) embed the SUBTOTAL within an OFFSET within a SUMPRODUCT

    b) use a Visible Flag in a column at source (eg a SUBTOTAL COUNTA per row which will return 1 (visible) or 0 (not visible))
    then you might consider using a SUMIF if single condition eg SUMIF(criteriacolumn,criteria,subtotalcountacolumn)
    I tried this,

    =SUMPRODUCT(SUBTOTAL(3;OFFSET(G14:G31;ROW(G14:G31)-ROW(G14);0;1));--(G14:G31="N"))*K12

    but it still counts the hidden cells too

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Countif only visible cells

    Quote Originally Posted by Jonathan78
    it still counts the hidden cells too
    Perhaps re-read my prior post ?

    Quote Originally Posted by D.O
    if you're not using AutoFilter then see the 101+ functions.
    Note: the 101+ don't exist prior to XL2003

  7. #7
    Forum Contributor
    Join Date
    08-19-2009
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    585

    Re: Countif only visible cells

    Now I understand the 101+ functions.
    Thanks for helping!

+ 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