The formula is structurally valid; test the underlying values in the failing row because Excel compares the stored values and data types—not merely the integers displayed in columns K and O.^1^
Identify the mismatch
For a row that displays K=6 and O=1 but does not return Y6, enter these tests in empty cells, replacing 7 with the failing row:
=K7=6
=O7=1
=ISNUMBER(K7)
=ISNUMBER(O7)
Expected results are four TRUE values. ISNUMBER distinguishes real numbers from text; quoted or text-stored numeric values are not automatically converted by this diagnostic function.^2^
Then temporarily increase the displayed decimal places for K and O. A cell displaying 6 might actually contain 6.0001, for example. Excel normally compares the complete stored value, even when formatting displays a rounded integer.^1^
You can also select the failing formula cell and choose Formulas → Evaluate Formula → Evaluate repeatedly. This shows which individual comparison becomes FALSE and can expose text or hidden spaces.^3^
Apply the matching correction
If ISNUMBER returns FALSE: the value is text, even if it looks like a number.
- Select the affected cells in K or O.
- Select the warning indicator, or press Alt+Shift+F10.
- Choose Convert to Number.
- Fill or recalculate the result formula.
Microsoft documents text-stored numbers as a cause of unexpected calculation behavior.^4^
If those columns intentionally contain either numeric text or numbers, coercion can instead be built into the formula:
=IF(AND(--K7=1,--O7=6),"Y1",
IF(AND(--K7=2,--O7=7),"Y2",
IF(AND(--K7=3,--O7=8),"Y3",
IF(AND(--K7=4,--O7=9),"Y4",
IF(AND(--K7=6,--O7=1),"Y6",
IF(AND(--K7=7,--O7=2),"Y7",
IF(AND(--K7=8,--O7=3),"Y8",
IF(AND(--K7=9,--O7=4),"Y9",""))))))))
This also replaces " "—one space—with "", a visually empty result.
If the equality test is FALSE because of hidden decimals: correct the formulas producing K and O, or compare rounded values only if those columns are intended to represent whole numbers:
=IF(AND(ROUND(K7,0)=6,ROUND(O7,0)=1),"Y6","")
Apply the same rounding pattern to the other conditions. Avoid enabling Set precision as displayed as a quick fix: Microsoft warns that it permanently changes stored values and the original precision cannot be restored.^1^
If all four tests return TRUE
Check calculation state:
- Select Formulas → Calculation Options → Automatic.
- Press Ctrl+Alt+F9 to force recalculation of all formulas in all open workbooks.
Excel supports Manual calculation mode, in which formula results can remain stale until recalculated.^1^
References
- [Windows](https://support.microsoft.com/excel/change-formula-recalculation-iteration-or-precision-in-excel)
- IS functions | Microsoft Support
- VALUE is Excel's way of saying, "There's something wrong with the way your formula is typed. Or, there's something wrong with the cells you are referencing." The error is very general, and it can be hard to find the exact cause of it. The information on this page shows common problems and solutions for the error.
- Convert numbers stored as text to numbers in Excel | Microsoft Support