How do you ignore hidden rows in a countif() function

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I'd like to count the number of cells with the value "Open" that are not
hidden.
1) =COUNTIF(L:L,"Open")
This does not ignore hidden rows
2) =SUBTOTAL(3,L:L)
This ignores hidden rows but counts everything

What I like is a way to combine these two functions:
1) Since {=SUM(IF(L1:L100="Open",1,0))} works, I tried modifying the sum to
be a subtotal, as such {=SUBTOTAL(9,IF(L1:L100="Open",1,0))} but this returns
a #VALUE error.

2) Is there an ishidden() function? I could do this:
{=SUM(IF(L1:L100="Open",IF(ISHIDDEN(L1:L100),1,0),0))}
But the ishidden() function does not exist.

3) I tried replacing the ISHIDDEN() with a CELL() function. This gets me
closer, CELL("width") return 0 if the column is hidden, but not if the row is
hidden, I'd need to use CELL("height"). The end result:
{=SUM(IF(L1:L100="Open",IF(CELL("height",L1:L100)>0,1,0),0))}
Does not work since CELL("height") does not work.

Thanks for your help,
Scott
.



Relevant Pages

  • Re: Why is inserting rows throwing off my hidden rows
    ... Inserting an *entire row* will automatically shift all lower rows ... down while maintaining the hidden attribute of hidden rows. ... you're doing is inserting *cells* which displace lower cells down to ... Use the same variable to tell Excel where to paste your data. ...
    (microsoft.public.excel.programming)
  • Re: Move Cursor Up
    ... do any of the cells in Column L of the hidden rows have values in them? ... Where did you want the "cursor" to be after the row is unhidden... ... Trouble is, on activation, the row unhides itself ok but the cursor ...
    (microsoft.public.excel.programming)
  • Re: Copy Paste a value down a column with autofilter on
    ... Just selecting the cells and hitting paste works fine for me. ... Hit paste without affecting the hidden rows. ... I have autofilter on for " LEVEL" and in the column ...
    (microsoft.public.excel)
  • Re: Do NOT find in hidden rows?
    ... for entire sheet), F5, Special cells, Visible cells, then do your find. ... formulas work, but should not be displayed on-screen. ... Now I find to my equal dismay that the interactive Find command DOES ... search in hidden rows. ...
    (microsoft.public.excel.programming)
  • Re: How do you ignore hidden rows in a countif() function
    ... need to tweek it a little? ... Scott ... >> This ignores hidden rows but counts everything ... Prev by Date: ...
    (microsoft.public.excel.worksheet.functions)