Equal Values Inconsistency

AspiringAutomater

New Member
Joined
Jul 31, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Excel appears to give inconsistent results on comparing values when the compared values are decimals other than .5 or integers. Oddly I found an approximate cut-off point for 0.9, but the inconsistency strikes other decimal figures at different thresholds. I believe I've eliminated formatting, display issues, and hopefully user error, and these did not go away after installing updates and relaunching/rebooting etc. Has anyone seen this before? What am I doing wrong or do you know how it can be fixed? Thank you.
 

Attachments

  • Equal Values.png
    Equal Values.png
    22.2 KB · Views: 4

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Yes...although I can't tell what the issue might be based on the image you've posted. See my commentary here:
I suspect you've encountered an Excel numerical precision issue that can lead to problems when logical comparisons are made. You may want to consider forcing numerical rounding to a known level of precision and then making the logical comparison.
 
Upvote 0
Solution
Thank you Kirk for such a quick answer. I read your explanation to the attached query and I agree you are probably right. I've included a tolerance figure, and I now get "TRUE" results. Instead of =A2=D2, =ABS(A2-D2)<.000005....but it works without ABS() whether A-D or D-A, which I believe also confirms your suspicion. Bit perplexing that this can apply to figures to only the tenths and hundredths places but we aren't going to solve that here!
 
Upvote 0
This issue appears regularly, even in some unexpected places where we know a number should be expressed exactly...but because of limitations handing the binary representation of values, there are some precision-rounding errors. Microsoft describes the issue here:
 
Upvote 0

Forum statistics

Threads
1,214,431
Messages
6,119,458
Members
448,899
Latest member
maplemeadows

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top