Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excel FILTER to return array non zero columns

I have an Excel table that has the following (plus more) data in it:

Start data

What I would like to do is filter the data to return all but the columns that have all 0 values in them, i.e. the return would be:

Expected outcome

I can't for the life of me get my filter expression to return what I want, any help would be greatly appreciated!

like image 625
Ikthezeus Avatar asked Nov 17 '25 09:11

Ikthezeus


1 Answers

With BYCOL and LAMBDA:

=FILTER(B1:I4,BYCOL(B2:I4,LAMBDA(a,SUM(a)))>0)

Or as @BigBen pointed out in a comment:

=FILTER(B1:I4,BYCOL(B2:I4,LAMBDA(a,OR(a)))

enter image description here

Since BYCOL and LAMBDA are not available to all office 365 users yet here is one that does not use it.

=FILTER(B1:I4,TRANSPOSE(MMULT(--((TRANSPOSE(B2:I4)<>0)),SEQUENCE(ROWS(B2:I4),,1,0))>0))

enter image description here

like image 155
Scott Craner Avatar answered Nov 19 '25 10:11

Scott Craner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!