Skip to main content
Post Undeleted by user79865
Post Deleted by user79865
added 679 characters in body
Source Link
user79865
user79865

You can include multiple conditions in a filter by using multiplication (which means logical AND). For example,

FILTER(D:AH, (A:A=A2) * LEN(E:E) * LEN(H:H))

requires A to be equal to A2 and E to be nonempty and H to be nonempty.

Conditions can also be combined using addition, which stands for logical OR:

FILTER(D:AH, (A:A=A2) * (LEN(E:E) + LEN(H:H)))

requires A to be equal to A2 and that either E or H be nonempty.

If you have a lot of columns (like D:AH), one of which must be nonempty, the formula will have to be somewhat long. Instead of adding lengths as above, one can use concatenation & to shorten it a bit:

FILTER(D:AH, (A:A=A2) * LEN(E:E & F:F & G:G & H:H & I:I & J:J & K:K & L:L & M:M & N:N & O:O & P:P & Q:Q & R:R & S:S & T:T & U:U & V:V & W:W & X:X & Y:Y & Z:Z & AA:AA & AB:AB & AC:AC & AD:AD & AE:AE & AF:AF & AG:AG & AH:AH))`

Long, but you only have to do it once.


By the way, I used a spreadsheet to generate the long string above, by making a column of letters (say, in A1:A30) and then using =join(" & ", arrayformula(A1:A30 & ":" & A1:A30)))

You can include multiple conditions in a filter by using multiplication (which means logical AND). For example,

FILTER(D:AH, (A:A=A2) * LEN(E:E) * LEN(H:H))

requires A to be equal to A2 and E to be nonempty and H to be nonempty.

Conditions can also be combined using addition, which stands for logical OR:

FILTER(D:AH, (A:A=A2) * (LEN(E:E) + LEN(H:H)))

requires A to be equal to A2 and that either E or H be nonempty.

You can include multiple conditions in a filter by using multiplication (which means logical AND). For example,

FILTER(D:AH, (A:A=A2) * LEN(E:E) * LEN(H:H))

requires A to be equal to A2 and E to be nonempty and H to be nonempty.

Conditions can also be combined using addition, which stands for logical OR:

FILTER(D:AH, (A:A=A2) * (LEN(E:E) + LEN(H:H)))

requires A to be equal to A2 and that either E or H be nonempty.

If you have a lot of columns (like D:AH), one of which must be nonempty, the formula will have to be somewhat long. Instead of adding lengths as above, one can use concatenation & to shorten it a bit:

FILTER(D:AH, (A:A=A2) * LEN(E:E & F:F & G:G & H:H & I:I & J:J & K:K & L:L & M:M & N:N & O:O & P:P & Q:Q & R:R & S:S & T:T & U:U & V:V & W:W & X:X & Y:Y & Z:Z & AA:AA & AB:AB & AC:AC & AD:AD & AE:AE & AF:AF & AG:AG & AH:AH))`

Long, but you only have to do it once.


By the way, I used a spreadsheet to generate the long string above, by making a column of letters (say, in A1:A30) and then using =join(" & ", arrayformula(A1:A30 & ":" & A1:A30)))

Source Link
user79865
user79865

You can include multiple conditions in a filter by using multiplication (which means logical AND). For example,

FILTER(D:AH, (A:A=A2) * LEN(E:E) * LEN(H:H))

requires A to be equal to A2 and E to be nonempty and H to be nonempty.

Conditions can also be combined using addition, which stands for logical OR:

FILTER(D:AH, (A:A=A2) * (LEN(E:E) + LEN(H:H)))

requires A to be equal to A2 and that either E or H be nonempty.