# How to Filter Integers in Google Sheets

This guide will explain how to filter integers in Google Sheets.

Filtering in Google Sheets is a powerful method for managing and analysing your data. By applying filters, you can selectively view specific rows in a spreadsheet while temporarily hiding others, making it easier to focus on relevant information.

While Google Sheets doesn’t offer a direct filter option for integers, we can use a combination of formulas and the built-in filter functionality to achieve this.

In this guide, we will provide a step-by-step tutorial on how to filter integers in your Google Sheets document. We will cover two methods: using the `FILTER` function and utilizing the Filter command.

## The Anatomy of the FILTER Function

The syntax of the `FILTER` function is as follows:

`=FILTER(range, condition1, [condition2, ...])`

Let’s look at each argument to understand how to use the `FILTER` function.

• range refers to the range of values you want to filter.
• condition1 must be a column or row containing TRUE or FALSE values corresponding to a selected column or row of the range. It can also be an array formula that evaluates to TRUE or FALSE values,
• condition2, … are optional additional conditions to consider in your filter. Rows or columns in your range must pass all conditions to appear in the output.
• Do note that all condition arguments must have the same array length as the range argument.

## A Real Example of Filtering Integers in Google Sheets

Let’s explore a few methods we can use when we need to filter integers in Google Sheets.

### Using the FILTER Function

In the table above, we have a range of values where we want to output a new range containing only the integers.

We can use the following `FILTER` function to filter for only integers:

`=FILTER(A2:A21,A2:A21=INT(A2:A21))`

In the `FILTER` function above, we’ve specified that we want to filter the range A2:A21 based on a certain condition. The condition argument A2:A21=INT(A2:A21) indicates that we are only interested in cells with values equal to their integer form. With this condition, cells that are already integers will return TRUE, while non-integer numbers will return FALSE.

In the table above, we added our `FILTER` function in cell C2 to output a new range of numbers containing only integers from our original dataset.

### Using the Filter Tool

We can also use the built-in Filter tool to apply a custom formula in our target range to hide all non-integer values.

In the example above, we applied a filter to our set of numbers in column A. To ensure that only integers are displayed, we’ll use the custom formula A2=INT(A2). In the next section, we’ll explain how to add this custom formula as a condition within a filtered range.

Click on the link below to create your own copy of our examples.

Head to the next section to read our step-by-step tutorial on how to filter integers in Google Sheets.

## How to Filter Integers in Google Sheets

1. Select the cell where you want to place the `FILTER` function. Ensure there is enough space below this cell to accommodate the `FILTER` function output.
In this example, we’ll use cell C2 for our `FILTER` function.
2. Type “=FILTER(“ in the selected cell to start the `FILTER` function.
3. For the first argument of the `FILTER` function, type the range you want to filter for integers.
In this example, we’ll use the range A2:A21.
4. Next, we’ll type out the condition statement to use for our `FILTER` function. The easiest way to check if a number is an integer is to use the `INT` function to convert the number into an integer and compare the result with the original number.
If the two numbers are equal, then the original number must be an integer.
In this example, we want to know if the values in the range A2:A21 are integers. We can use the condition A2:A21=INT(A2:A21) to compare each value in the range with its integer equivalent.
5. Hit the Enter key to evaluate the function.
The formula should return a filtered array with only the integers from the target range.
6. Another way we can filter integers in Google Sheets is by using the Filter tool and a custom formula.
Select the range you would like to filter and click Data > Create a filter.
7. Click on the filter icon in the header of the selected column. Under the Filter by condition section, click the Custom formula is option from the dropdown menu.
We’ll use the formula =A2=INT(A2) to help filter integers in the range. Click on OK to apply the new filter.
8. The filtered range should now show all the integer values in the range

These are all the steps you need to know to start filtering integers in Google Sheets.

## FAQs

1. Can I use conditional formatting to highlight integers in a range?
Yes, you can use conditional formatting to highlight integers in a range. We can use the custom formula =A1=INT(A1) to highlight cells that contain integer values. You can access the conditional formatting tool by clicking Format > Conditional formatting.

2. Is it possible to filter integers in a range that also meets other criteria?
Yes, you can combine integer filtering with other criteria. For instance, if you want to filter integers in a range that is non-negative, use a formula like =AND(A1=INT(A1), A1>=0) as a condition for the `FILTER` function or Filter tool.

That’s all for this guide! Be sure to check out our library of spreadsheet resources, tips, and tricks!

### Get emails from us about Excel.

Our goal this year is to create lots of rich, bite-sized tutorials for Excel users like you. If you liked this one, you'd love what we are working on! Readers receive early access to new content.

## How to Use Index with Match for 2D Array Result in Google Sheets

This guide will explain how to use the INDEX and MATCH functions to return a 2D array. INDEX…

## How to Use LOWER Function in Google Sheets

The LOWER function in Google Sheets is useful if you want to convert a given text into small…

## How to Format Individual Data Points in Google Sheets

Let’s learn how to format individual data points in Google Sheets which may be useful to highlight certain…

## How to Fix ‘Filter Has Mismatched Range Sizes’ Error in Google Sheets

Very often than not, we would face some trouble with formulas in Google Sheets. A common error that…