'counting the number of rows on a table containg data

In googlesheets i'd like a formula that looks at an entire table and for each row that contains data it comes back as 1, and adds all those 1s togteher. All I;ve come up with some far is a formula that repeats the action of looking at one

ie

(if(COUNT(IMPORTRANGE($C11,($D11&"!"&(HLOOKUP((match(K$1,(IMPORTRANGE($C11,($D11&"!$A$3:$ZZ$3"))) ,0)),Lookups!$7:$8,2))&"6:"&(HLOOKUP((match(L$1,(IMPORTRANGE($C11,($D11&"!$A$3:$ZZ$3"))) ,0))-1,Lookups!$7:$8,2))&"6")))>0,1,0))+

(if(COUNT(IMPORTRANGE($C11,($D11&"!"&(HLOOKUP((match(K$1,(IMPORTRANGE($C11,($D11&"!$A$3:$ZZ$3"))) ,0)),Lookups!$7:$8,2))&"7:"&(HLOOKUP((match(L$1,(IMPORTRANGE($C11,($D11&"!$A$3:$ZZ$3"))) ,0))-1,Lookups!$7:$8,2))&"7")))>0,1,0))+

(if(COUNT(IMPORTRANGE($C11,($D11&"!"&(HLOOKUP((match(K$1,(IMPORTRANGE($C11,($D11&"!$A$3:$ZZ$3"))) ,0)),Lookups!$7:$8,2))&"8:"&(HLOOKUP((match(L$1,(IMPORTRANGE($C11,($D11&"!$A$3:$ZZ$3"))) ,0))-1,Lookups!$7:$8,2))&"8")))>0,1,0))+

and so on



Solution 1:[1]

Assuming a table in the range A1:C8, use:

=sum(index(n(mmult(n(A1:C8<>""),sequence(columns(A1:C8))^0)>0)))

enter image description here

Solution 2:[2]

try:

=INDEX(COUNTA(TRIM(FLATTEN(QUERY(TRANSPOSE(A1:C),,9^9)))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ztiaa
Solution 2 player0