fish asked in Computers & InternetSoftware · 2 months ago

excel help?

i have a formula (row C2:C20) which starts with iferror, so the result could return a blank cell if there's an error.  Now if the cell return me a value or a text (which ever my it may be), is there a way that i could count only the visible results? not counting the blanks.  So if i have values in C2:C5 and blanks on C6:C20, i only want to count C2:C5 to =4

thx. 

Update:

if C2:C20 are blanks it should =0

2 Answers

Relevance
  • 2 months ago

    If you put "" as the result for a blank cell, COUNTIF should work. However, if you used "0" as the result, countif will count the Zeros too. 

    =COUNTIF(C2:C20,"<>")

    This formula will count only nonblank cells, but will count any cell with zero as a formula result or implied through a formula. 

    =COUNTIF(C2:C20,">0")

    this formula will count any cell that is not blank or is not Zero (0)

  • JASON
    Lv 6
    2 months ago

    =COUNTIF(C2:C20,">0")

    You might have to amend your IFERROR statement to return a zero, if it's set up to put a blank there.

Still have questions? Get your answers by asking now.