google-sheetsgoogle-sheets-formula

How to count number of non-blank cells (cells that contain text)?


I want to count the cells that contain anything within a range. Any cell that contain text, or numbers or something else should do a plus one in my result-cell.

I found this function,

countif(range; criteria)

but this doesn't work for me, because I don't know what to type in the criteria. How can I do this?


Solution

  • You can pass "<>" (including the quotes) as the parameter for criteria. This basically says, as long as its not empty/blank, count it. I believe this is what you want.

    =COUNTIF(A1:A10, "<>") 
    

    Otherwise you can use CountA as Scott suggests