You can also try:
=COUNTA(FILTER(B:G,A:A="Smith"))

google sheets - COUNTIF OR COUNTA - Stack Overflow
countif - COUNTA not working as I expect in new Google Sheets - Stack Overflow
Why is my COUNTA function counting seemingly empty cells in Google Sheets?
Google sheet COUNTA with arrayformula - Stack Overflow
You can also try:
=COUNTA(FILTER(B:G,A:A="Smith"))

The COUNTA Function is categorized under Excel Statistical functions. It will calculate the number of cells that are not blank within a given set of values. The COUNTA function is also commonly referred to as the Excel COUNTIF Not Blank formula.
The COUNTA function is useful if we wish to keep a count of cells in a given range. Apart from crunching numbers, we often need to count cells with values. In such a scenario, the function can be useful.
See Also: Count rows with not empty value
Unfortunately, this is functions as designed from Google.
Although I'm not sure why it's divergent from the way that Excel calculates COUNTA.
According to the Google Spreadsheet Documentation on COUNTA:
COUNTA counts all values in a dataset, including those which appear more than once and text values (including zero-length strings and whitespace).
Meaning that the only way to "make [the cells] completely empty" is to delete the entire contents, formula and all. But fear not...
Some workarounds:
Hypothetically, you should be able to do this with
=COUNTIF(A3:A8,"<>"&""), but Google spreadsheets doesn't support the not equal to operator in the COUNTIF function according to these forums: 1, 2, 3A workaround is to create a truthy or falsy array based on the condition and use SUMPRODUCT to count the truthy values like this:
=SUMPRODUCT((A3:A8<>"")*1)Another option you could pursue would be to write a custom function and add it to Drive.
It's actually pretty easy to do so. Go to Tools > Script Editor and add the following script:/** * Works like COUNTA except does not include null strings * * @param {cellRange} myArray The value or range to consider when counting. * @return Returns the a count of the number of values in a dataset. * @customfunction */ function CountNotBlank(myArray) { var output = 0; for (i = 0; i < myArray.length; i++) { if (myArray[i] != "") { output += 1 } } return output; }Then use like this:
=CountNotBlank(I31:I)
I would try: =IF(ISNUMBER(D31), "X", iferror(1/0))
I am told that the iferror(1/0) returns nothing at all.
Here is a fairly straightforward approach:
=ArrayFormula(IF(B2:B="",,COUNTIFS(B2:B,"<>",ROW(B2:B),"<="&ROW(B2:B))))
It basically reads "If any cell in Column B is blank, leave the return blank; otherwise count the non-blank entries in Column B including only content in rows less than or equal to the current row number."
Try
=arrayformula(if(B2:B="",,mmult(1*(transpose(row(B2:B))<=row(B2:B)),IF(B2:B="",0,1))))
Trying to figure out the appropriate interaction between these two functions... What I'm looking to do is show a count of non-blank cells in a row from F:J if C is not blank and have it automatically copy down
Here's what I tried...
=ARRAYFORMULA(IF($C$6:$C)="","",COUNTA($F$6:$J)))
^ This seems to count everything in F6:J and copies that answer to all rows
=ARRAYFORMULA(IF($C$6:$C="","",COUNTA($F$6:$J$6)))
^Tried this and it returns the proper count on the row, but again duplicates that answer to all rows