Formula Errors

Fix Excel IF Comparisons for Values That Appear Equal

Emma BrownEmma Brown Nov 27, 2026 869 views

Question details

The user needs an Excel IF formula to compare calculated values that appear equal.

Fix Excel IF Comparisons for Values That Appear Equal
Product
Microsoft Excel
Device & OS
not provided
Scenario
An IF formula compares calculated amounts displayed with currency formatting.
Observed behavior
The formula returns an unexpected result even though the displayed amounts look identical.
Before you start

Identify the cells being compared and decide how many decimal places matter for the calculation. Currency formatting may show two decimal places without changing the underlying values.

Solution 1Recommended

Round Both Values Before the Excel IF Comparison

Use ROUND on each side of the comparison to ignore differences beyond the precision relevant to your data.

Calculated values can contain small floating-point differences that are hidden by number formatting. Rounding both values makes the comparison use the chosen decimal precision.

1
Select the formula cell

In Excel, select the cell containing the IF formula that compares the calculated values.

2
Round both sides

In the formula bar, enter =IF(ROUND(D2,2)=ROUND(H2,2),"OK","No"), replacing D2 and H2 with your cells.

3
Choose the precision

Replace 2 in both ROUND functions with the number of decimal places appropriate for your data, then press Enter.

4
Round a calculated total if needed

If a total should be rounded before later use, select its cell and use a formula such as =ROUND(SUM(H2:H11),2).

Round Both Values Before the Excel IF Comparison
Rounding is not a tolerance test: Values on opposite sides of a rounding boundary can still compare as different, even if the difference between them is very small.
Work with formulas in WPS Spreadsheets

Compare Rounded Values in WPS Spreadsheets

Open your workbook in WPS Spreadsheets and use IF with ROUND to compare calculated values at the precision your data requires.

  1. 1. Open the workbook: In WPS Office, open your Excel workbook in WPS Spreadsheets.
  2. 2. Select the comparison cell: Click the cell where you want to enter or edit the IF formula.
  3. 3. Enter the formula: In the formula bar, enter =IF(ROUND(D2,2)=ROUND(H2,2),"OK","No"), adjusting the cell references and decimal places as needed.
  4. 4. Check the result: Press Enter and review the result in the formula cell; use File > Save to save your changes.
Compare calculated amounts using IF and ROUND.Open and edit Microsoft Excel XLS and XLSX files.Use a familiar spreadsheet interface to review formulas.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel say two currency values are different when they look the same?

Currency formatting controls what is displayed, not necessarily the stored value. Calculations can leave small floating-point differences that an equality test detects.

How do I compare values to the nearest cent?

Round both values to two decimal places in the IF formula, for example: =IF(ROUND(D2,2)=ROUND(H2,2),"OK","No").

Can I round a SUM before comparing it?

Yes. Use a formula such as =ROUND(SUM(H2:H11),2) in the total cell, or apply ROUND to the SUM expression within your comparison.

Does rounding guarantee that any two nearly equal values will match?

No. Values on opposite sides of a rounding boundary can round differently. Choose the decimal precision based on how the values should be treated in your calculation.