Skip to main content

Kutools for Office — One Suite. Five Tools. Get More Done.

How to compare numbers but allowing a tolerance in Excel?

Author Xiaoyang Last modified
A screenshot showing a comparison of two columns of numbers in Excel with a tolerance applied

In Excel, using the standard formula =A1=B1 will directly compare the values in cell A1 and B1, and display TRUE only if they are exactly the same. However, in many practical scenarios—such as data analysis, quality control, or financial projections—you may need to determine if two numbers are "close enough" rather than exactly equal. This could be due to small rounding differences, acceptable measurement errors, or thresholds in calculation results.

For example, you might want to check whether the absolute difference between two results is within ±5 units. Excel does not provide a built-in direct function for comparing with a tolerance, but with formulas, custom functions, or add-ins, you can easily perform this type of comparison.


arrow blue right bubble Compare two numbers but allowing a tolerance with formulas

Excel formulas allow you to compare two numbers and check whether the difference between them falls within a specific tolerance. This is particularly useful when you routinely work with approximate values or need to account for minor deviations.

1. In a blank cell next to the numbers you want to compare (for example, if you want to compare A1 and B1, you might use cell C1), enter any of the following formulas:

=AND(A1<=B1+5,A1>=B1-5)

=ABS(A1-B1)<=5

The first formula checks if A1 is between B1 -5 and B1 +5, while the second formula determines whether the absolute difference between A1 and B1 is less than or equal to 5. Either formula will return TRUE if the two numbers are within the specified tolerance, or FALSE otherwise.

Note: In these formulas, A1 and B1 represent the cells containing the numbers you wish to compare, and 5 is the tolerance range. You can replace "5" with any other value to meet your requirements, including using a cell reference for a flexible, per-row tolerance setting.

This method is fast and suitable for comparing a moderate number of values in a straightforward, tabular format. It is especially recommended when your comparison logic is simple, and you do not need to reuse the comparison formula across multiple places in your workbook.

A screenshot of formulas used to compare numbers with a tolerance in Excel

2. Press Enter to confirm the formula. To apply this comparison to an entire column, drag the fill handle down (the small square in the bottom right corner of the cell) so the formula copies to adjacent rows. Each result will indicate TRUE if the compared values are within your specified tolerance, or FALSE otherwise, as shown below:

A screenshot showing a comparison of two columns of numbers in Excel with a tolerance applied

Tip: If you need to use varying tolerance values for each row, replace the number 5 with a reference to a cell (e.g., ABS(A1-B1)<=C1), where C1 contains the desired tolerance.

Precautions and troubleshooting: Ensure all referenced cells contain numerical values; text or blank values may cause errors or unexpected results. If the formula returns a #VALUE! error, check for invalid data types or extra spaces in your cells.


Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

Excel Word Outlook Tabs PowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in