samedi 20 juin 2020

Count the number of rows that meet any criteria in some columns (OR-like operation)

Say we have the following table:

|  A  |  B  |  C  |  D  |
| --- | --- | --- | --- |
|  0  |  T  |  0  |  T  | (B[0] == T OR D[0] == T)
|  1  |  T  |  1  |  T  | (B[1] == T OR C[1] > 0 OR D[1] == T)
|  2  |  T  |  0  |  F  | (B[2] == T)
|  3  |  F  |  0  |  F  | (doesn't meet any criteria)
|  4  |  F  |  2  |  F  | (C[4] > 0)
|  5  |  F  | -1  |  F  | (doesn't meet any criteria)

I hope to do something like COUNTORS(B:B, true, C:C, ">0", D:D, true) that returns 4.

That is, for a single row, if any value in column B, C, D meets the criteria, then we should count it (+=1).

Aucun commentaire:

Enregistrer un commentaire