Ravindra BagaleCourses & study guides मराठी Track your progress

9. Dynamic Arrays

9.2 FILTER

FILTER with two conditions with example — in 30 seconds

What: FILTER returns only the rows that pass your test, and the result spills into the cells below.

Why: A live list on a report sheet updates by itself when new data arrives. No more copy, filter, paste.

Tiny example: Pune AND Delivered gives 3 rows: BLK-1001, AMN-1003, BLK-1006. =FILTER(tblMini, (tblMini[City]="Pune")*(tblMini[Status]="Delivered"))

First look at the data (before → after):

FILTER with two conditions with example: before and after tables, fictional FreshGo Maharashtra data

Expected result — Spilled result (selected columns)

Order ID City Amount Status
BLK-1001 Pune 64 Delivered
AMN-1003 Pune 110 Delivered
BLK-1006 Pune 150 Delivered

About this data: Teaching sample for a fictional shop “QuickCart Delivery”. Figures and names (e.g. Meera Joshi) are made up for this lesson on filter.

Before table and formula as text

Before — tblMini columns used

Order ID City Status
BLK-1001 Pune Delivered
BLK-1002 Nashik Delivered
AMN-1003 Pune Delivered
BLK-1004 Nagpur Cancelled
AMN-1005 Kolhapur Delivered
BLK-1006 Pune Delivered
BLK-1007 Solapur Delivered
AMN-1008 Sambhaji Nagar Returned
BLK-1009 Pune Cancelled
BLK-1010 Nashik Delivered

About this data: Demo table only — not real customer or company data. Built to practise filter.

Formula / click path

K2: =FILTER(tblMini, (tblMini[City]="Pune")*(tblMini[Status]="Delivered"))
* = AND · + = OR

Do it step by step:

  1. Click K2 on an empty area of the sheet.
  2. Type =FILTER(tblMini, (tblMini[City]="Pune")*(tblMini[Status]="Delivered")).
  3. Press Enter. The rows spill down with a blue border.
  4. Wrap each test in brackets. The * between them means both must be TRUE.
  5. Add a third argument like "No rows" to show a message when nothing matches.

=FILTER(array, include, [if_empty])

Need Formula
All Pune orders =FILTER(tblMini, tblMini[City]="Pune")
Pune AND Delivered =FILTER(tblMini, (tblMini[City]="Pune")*(tblMini[Status]="Delivered"))
Pune OR Nashik =FILTER(tblMini, (tblMini[City]="Pune")+(tblMini[City]="Nashik"))
Orders > value in cell M1 =FILTER(tblMini, tblMini[Amount]>M1, "No orders")
Only some columns =FILTER(tblMini[[Order ID]:[City]], tblMini[Mins]>15)
Text contains "Fruit" =FILTER(tblMini, ISNUMBER(SEARCH("Fruit", tblMini[Category])))

About this data: Made-up rows so you can copy the pattern for filter. Currencies may use ₹, £, € or $.

Worked example. Pune and Delivered returns three rows: BLK-1001 (₹64), AMN-1003 (₹110), BLK-1006 (₹150). If the criteria match nothing and if_empty is missing, FILTER returns #CALC! – always give if_empty.

Ravindra Bagale's Tip

In FILTER, * is for AND and + is for OR – many students use them the wrong way round, or use the AND() function, which doesn't work on arrays. Write it as (cond1)*(cond2), with each condition in brackets. And give if_empty, otherwise an empty result shows #CALC!.

Practice task

Build a mini report: a City drop-down in M1 and a FILTER that shows that city's delivered orders with only Order ID, Date and Amount columns; show "No orders" when empty.

Loading practice tasks...

  1. Pune customers (spill) (Easy): Show customers (B2:B8) where branch is "Pune".
  2. Approved loan IDs (spill) (Easy): Show A2:A8 where Status is "Approved".
  3. Big loans (spill) (Easy): Show customers with amount over 1000000.
  4. Personal loan amounts (spill) (Easy): Show E2:E8 where Type is "Personal".
  5. Full rows for Goa (spill) (Medium): Show A2:F8 rows where branch is "Goa".
  6. Approved in Pune (spill) (Medium): Customers in Pune AND Approved.
  7. Home or Car (spill) (Medium): Customers with Home OR Car loans.
  8. Total approved (Medium): Total amount of Approved loans.
  9. Nothing found message (Hard): Show customers from "Delhi", or "None" if none.
  10. Count pending (Hard): How many loans are Pending?
  11. Name and amount, Kochi (spill) (Hard): Show customer, branch, type and amount (B2:E8) for Kochi.

Quick revision cards

Three standalone cards. Each one explains the idea with its own example. Scan the QR to open this lesson.

Revision card 1: What is Filter?
Card 1: What is Filter? · Download PNG
Revision card 2: Tiny example — Filter
Card 2: Tiny example — Filter · Download PNG
Revision card 3: Checklist — Filter
Card 3: Checklist — Filter · Download PNG