Skip to main content

How to compare two numbers with decimal numbers in Excel?

Supposing there are two columns of decimal numbers, and you just want to compare two numbers in each row by the decimal numbers only as below screenshot shown. How can you quickly solve this job in Excel?
doc compare decimal only 10

Compare two decimal numbers with formula

Compare two decimal numbers with Extract Text


Compare two decimal numbers with formula

To compare only two decimal numbers between two numbers, you can apply following formulas as you need.

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:

doc compare decimal only 1 shot arrow right doc compare decimal only 2

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 just want to compare decimal numbers by 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, with more than 300 handy functions, makes your jobs more easier. 

After installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)

1. Select the two columns numbers you want to compare, and click Kutools > Text > Extract Text. See screenshot:
doc compare decimal only 3

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

doc compare decimal only 4 shot arrow right doc compare decimal only 5

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:
doc compare decimal only 6
doc compare decimal only 7

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:

doc compare decimal only 8 shot arrow right doc compare decimal only 9

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

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...

Description


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!
Comments (1)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
queria um resumo disso
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations