Using AND within a FILTER within an ArrayFormula in a GSheet

So I’m talking Google Sheets here, one of the types of available Google Docs. Sheets is like Excel – in many ways. It’s also different – in many ways.

So I recently had a situation where I needed to filter data from one sheet (tab) into another. In English it would have read:

Bring me in the 5th column, of all the rows from the sheet called “Raw Data”, where the 11th column has a date of either today or later and the 4th column says anything other than “TEST”.

Eventually and after a lot of experimentation, I ended up with the forumla above, which on the whole, is self-explanatory.

Except for that ‘*‘!

The FILTER function has two parameters:

What to filter:

'Raw Data'!E:E,

and the criteria to use:

('Raw Data'!K:K>=TODAY())*('Raw Data'!D:D<>"TEST")

And that ‘*‘ in the middle? Well it’s simply GSheet’s way of saying ‘AND’. (A ‘+‘ is used to mean ‘OR’).

In Excel you’d say something like:

AND('Raw Data'!K:K>=TODAY(),'Raw Data'!D:D<>"TEST")

And so we end up with:

=ArrayFormula(FILTER('Raw Data'!E:E,('Raw Data'!K:K>=TODAY())*('Raw Data'!D:D<>"TEST")))

 

Advertisements

About Words of Little Relevance

Freelance stage manager; software and web tester; Excel and map geek; Tweeter; Blogger and Cake Eater. Often back-stage in and around Oxfordshire and Buckinghamshire where I move scenes, or play with lights or sound.
This entry was posted in Technical and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s