# Filter by the sum of two cells

Let's say we have some data in a spreadsheet like:

``````  A         B          C
Price    Quantity    Genre
20        2500       Car
10        1000       Car
10        2500       Bike
``````

I can filter `Cars` with `Quantity` `2500` with `FILTER(A:A;B:B=2500;C:C="Car")` - easy.

But what if there is another column, for `Postage`, like:

``````  A         B          C         D
Price    Quantity    Genre    Postage
20        2500       Car       0
10        1000       Car       6
10        2500       Bike      10
``````

I want to filter to find everything whose total price (`Postage`+`Price`) is `20`, and I have `2500` of. I tried various combinations but can't seem to do it.

Should I create a sum column first?

Use the following formula to accomplish that.

I used the following dataset: Take notice of the extra ID I added.

## Formula

``````=QUERY(DATA!B1:F4, "SELECT F, D WHERE B+E>=20 AND C=2500")
``````

## Explained

The two `WHERE` clauses will set the criteria:

• Column C to 2500
• The result of the summation of column B + E to be larger or equal than 20

Column F and D are there to categorise the result.

## Result ## Example

I've created an example file for you: Filter by the sum of two cells in Google Spreadsheet