Level 3QUERYPractice, 3 min
QUERY: where, and order by
The task
In G1, list the Paid Search campaigns with more than $5,000 in revenue, biggest first:
=QUERY(A1:E13, "select A, E where B = 'Paid Search' and E > 5000 order by E desc")The data
The starting sheet. Cells outlined in green are where your formulas go.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Campaign | Channel | Spend | Leads | Revenue | ||
| 2 | Brand terms | Paid Search | $2,400 | 96 | $14,400 | ||
| 3 | Competitor terms | Paid Search | $3,100 | 41 | $2,950 | ||
| 4 | Product terms | Paid Search | $5,200 | 88 | $17,600 | ||
| 5 | Prospecting video | Paid Social | $4,600 | 52 | $3,980 | ||
| 6 | Lookalike 1% | Paid Social | $3,800 | 61 | $9,120 | ||
| 7 | Retargeting | Paid Social | $1,900 | 47 | $8,550 | ||
| 8 | Webinar promo | $600 | 73 | $4,380 | |||
| 9 | Newsletter | $250 | 22 | $1,750 | |||
| 10 | Win-back | $400 | 18 | $3,240 | |||
| 11 | Display remarketing | Display | $1,700 | 23 | $2,890 | ||
| 12 | Contextual | Display | $2,200 | 14 | $1,430 | ||
| 13 | YouTube | Display | $3,300 | 19 | $2,310 |