How to Filter and Work with Decimal Numbers in Google Sheets

Published on

Imagine you have a list in Google Sheets containing a mix of decimal and integer numbers. How can you filter only the decimal numbers from this list?

This is Question #1, which I’ll answer in this tutorial. As a bonus, I’ll also tackle Question #2:

How can you filter decimal numbers with specific decimal fractions?

For example, filtering numbers with a fraction of 0.25—but you can easily modify this to suit your needs.

Formula to Filter Decimal Numbers in Google Sheets

To filter decimal numbers, we’ll use the INT function along with either IF or FILTER. Both approaches achieve the same goal but produce slightly different outputs:

  • INT with IF: May leave blank cells in the results where no match is found.
  • INT with FILTER: Returns only the matching values without blank cells.

First, let’s learn how to filter decimal numbers. Then, we’ll cover how to filter numbers with specific decimal fractions. The formulas for both are nearly identical, with the main difference being the comparison operator used.

How to Filter Decimal Numbers in Google Sheets

Here’s the formula to extract decimal numbers:

=ArrayFormula(IF(A2:A-INT(A2:A)<>0, A2:A, ))
  • The range A2:A contains the input data.
  • Use this formula in cell B2.
  • Before applying the formula, ensure the range B2:B is clear of any values or formulas.
Example: Returning Decimal Numbers Using IF and INT in Google Sheets

Alternatively, you can use the FILTER function to achieve the same result:

=FILTER(A2:A, A2:A-INT(A2:A)<>0)
Example of Filtering Decimal Numbers in Google Sheets

Both formulas will do the job, but the FILTER version excludes blank rows.

Additional Tip

If you apply the above formulas to a column containing dates and timestamps, they will return the timestamps. This is because dates in Google Sheets are stored as integers, while times are stored as fractions of a day. Therefore, a timestamp is treated as a decimal number.

Filter Specific Decimal Fractions in Google Sheets

To filter decimal numbers with a specific fraction (e.g., 0.25), modify the formula as follows:

Formula #1 (Using INT with IF):

=ArrayFormula(IF(A2:A-INT(A2:A)=0.25, A2:A, ))

Formula #2 (Using INT with FILTER):

=FILTER(A2:A, A2:A-INT(A2:A)=0.25)

Both formulas will return numbers with the desired fraction (e.g., 0.25). For instance, if the dataset contains 100.25, 300.25, and 0.25, these numbers will appear as output.

Key Takeaways

To filter decimal numbers in Google Sheets, you can combine the INT function with either IF or FILTER. This approach effectively separates decimal numbers from integers in your data.

If you need to filter specific decimal fractions, you can adjust the formula by replacing 0.25 with your desired fraction. This allows for precise filtering tailored to your requirements.

For cleaner outputs without blank cells, the FILTER function is the ideal choice, as it directly excludes non-matching values.

Additional Resources

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

How to Extract Numbers from Text in Excel with Regex

You can use the REGEXEXTRACT or REGEXREPLACE functions to easily extract numbers from text...

Using OFFSET and MATCH Together in Google Sheets: Advanced Tips

One powerful and flexible way to look up values is by combining the OFFSET...

How to Use OFFSET and XMATCH Functions Together in Excel

We often use the OFFSET and XMATCH functions together to match a value in...

How to Calculate Maximum Drawdown in Excel and Google Sheets

You can use the following dynamic array formula to calculate maximum drawdown (MDD) in...

More like this

Using OFFSET and MATCH Together in Google Sheets: Advanced Tips

One powerful and flexible way to look up values is by combining the OFFSET...

Running Count with Structured References in Google Sheets

Running a count with structured references is achievable in Google Sheets tables using the...

Running Total with Structured Table References in Google Sheets

You can use two types of formulas to create a running total with structured...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.