简体   繁体   中英

Excel Conditional Formatting and Rounding Issues

I am trying to find a way to use excel formatting to show the color red when a specific cell is not equal to another cell. However, there are times when the value is off by two or three numbers due to how excel rounds(ex: 593=594, 593=592).Is there a way to use excel formatting or any other way to make it so if the value of the cell is very close to the targeted cell, it will not result in the cell being formatted to red. Anyway this the simple formula I am working with along with example:

=I3<>F3
EX:

**I**    **F**
593       594

Essentially the F cell will be highlighted in red but because the difference is negligible, I don't want to highlight red. At most, I would like to have a difference of more than 3, where the cell won't highlight red.

You should consider the absolute difference between the two numbers. If it is in a given range, which is acceptable, you may consider them equal. Thus, this is the formula that you need:

=ABS(I3-F3)>0,5 '0.5 if you are using "." as a decimal separator

It will consider 233.4 and 233.6 as similar values. MSDN ABS


In general, if you write =ABS(I3-F3)>0,5 in Excel it should evaluate to TRUE or FALSE . If it does not, probably the comma is the problem, thus change the comma with a dot - . .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM