0
votes

So I have a large dataset (say 7 columns with 941 rows) in Google Sheets.

For each row, if it contains a 1 (that value being returned by a formula in a said cell) in any column, I want it to be counted once.

I did some research and found these two threads.

So I used the Arrayformula from the previous StackOverflow 1. I made a table with 'x' instead of 1 to try it out. It works - but only for a max of 200 rows (or so) at a time. Apparently it is hitting a maximum number of values for arrayformula (40k?). So I guess I could count all my 941 rows... 200 at a time and then adding those together? Is there a more elegant workaround?

I tried the countif formula from the Reddit link 2 (which should count each row once if it contains a number) and couldn't even get it to work for a smaller data set (see sheet) - no idea what I'm doing wrong!

So to restate, I'm looking for help figuring out how to create a single formula to count a row once if it contains a 1 in any column - for a data set that's some 900+ rows and multiple columns.

1
share a copy of your sheet with example of desired result - player0

1 Answers

1
votes

I think this should work if your 7 columns are A:G.

=ARRAYFORMULA(SUM(N(MMULT(N(A2:G=1),SEQUENCE(7,1,1,0))>0)))