Skip to main content

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

How to compare only decimal parts of two numbers in Excel?

Author Sun Last modified

If you have two columns of numbers with decimal places and need to compare only the decimal portions, Excel provides methods to achieve this without manually checking each number. This tutorial covers two ways to quickly compare decimal parts only: using formulas to ignore the whole number portion and the Extract Text feature in Kutools for Excel to isolate decimals.
A screenshot of decimal comparison example

Compare two decimal numbers with formula

Compare two decimal numbers with Extract Text


Compare two decimal numbers with formula

To compare the decimal numbers between two numbers, you can apply the following formulas as needed.

Select a blank cell next to the two numbers you want to compare, type this formula =IF((FLOOR(A1, 0.01)-FLOOR(B1, 0.01))=0,1,-1), press Enter key, and to drag fill handle down to compare two columns. In the calculated results, 1 indicates the two decimal numbers are the same, while -1 marks the two decimal numbers are different. See screenshot:

A screenshot showing decimal comparison formula usage Arrow right A screenshot of compared decimal results

Note: In above formula, A1 and B1 are the two numbers you want to compare, 0.01 indicates to compare decimal numbers by two digits.

Tip: If you want to round the decimal firstly and then compare, you can use one of following two formulas.

In the formulas, 2 indicates to compare first two digits in decimal numbers, A1 and B1 are the numbers you want to compare.

=IF((ROUND(A1,2)-ROUND(B1,2))=0,1,-1)

=IF(ROUND(A1,2)=ROUND(B1,2),"ok","!!ERROR!!")


Compare two decimal numbers with Extract Text

If you want to compare decimal numbers by only the first two or first n digits, you can apply the Extract Text utility of Kutools for Excel to extract the decimal numbers you need first, and then use a simple formula to compare them.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

1. Select the two columns of numbers you want to compare, and click Kutools > Text > Extract Text. See screenshot:
A screenshot of Extract Text option in Kutools tab on the ribbon

2. In the Extract Text dialog, type .?? into the Text box, and click Add to add this criterion into the Extract list. See screenshot:

A screenshot of Kutools Extract Text dialog Arrow right A screenshot of Extract list criteria

3. Only check the new criterion in the Extract list section, and click Ok. Then select a cell to place the extracted decimal numbers, and click OK to finish. See screenshot:
A screenshot of decimal placement selection
A screenshot of extracted decimal numbers

4. In the adjacent cell to the extracted numbers, type this formula =IF((D1-E1)=0,1,-1), type Enter key, and to drag fill handle down to the cells you need. In the results of calculations, 1 indicates the two numbers are the same, -1 shows the numbers are different. See screenshot:

A screenshot showing decimal comparison formula usage Arrow right A screenshot of compared decimal results

Demo: How to compare two numbers by decimal only using Kutools for Excel

 
Kutools for Excel: Over 300 handy tools at your fingertips! Enjoy permanently free AI features! Download Now!

Relative Articles

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