Excel EXACT Function Not Working? Causes and Fixes

Errors & fixes · Updated November 3, 2026

Excel EXACT Function Not Working? Causes and Fixes

If Excel’s EXACT function seems not to work, check whether the values differ by letter case, spaces, or hidden characters: EXACT returns TRUE only when its two text strings match exactly, including case. With the values in A2 and B2, enter =EXACT(A2,B2); TRUE means they match and FALSE means at least one character differs.

What the EXACT function does

EXACT is a text-comparison function available in Excel for Microsoft 365 and older Excel versions. Its purpose is to test whether two text strings are identical. Unlike a basic text comparison with the equals operator, EXACT is case-sensitive: “North” and “north” are different to EXACT.

For a direct comparison with the values in A2 and B2, use =EXACT(A2,B2). The result is the logical value TRUE or FALSE, not the words “same” or “different.” If you want a readable label, with the values in A2 and B2, use =IF(EXACT(A2,B2),"Match","No match"). This returns Match for identical strings and No match otherwise.

EXACT compares cell contents, not how they look on screen. Font, fill color, bold formatting, and number format do not determine the result. Two cells can look alike but contain different characters, or look different because of formatting while holding equivalent content. That distinction is behind many reports that the function is broken.

Check case sensitivity first

Case sensitivity is the most common surprise. If A2 contains “Invoice” and B2 contains “invoice,” EXACT returns FALSE even though the words may be treated as equal in ordinary Excel searches or comparisons. That is expected behavior, not a calculation error.

If you want a case-insensitive comparison instead, with the text values in A2 and B2, use =A2=B2. For those two values, Excel returns TRUE when the text matches without regard to capitalization. Use EXACT when capitalization is meaningful, such as comparing product codes, passwords, or identifiers whose case must be preserved. Use the equals operator when the words should count as the same regardless of capitalization.

Do not change the source text just to make a case-sensitive check pass unless that is the intended rule. Converting both values to uppercase or lowercase would remove the very distinction EXACT is designed to detect.

Look for extra spaces and invisible characters

A leading space, trailing space, or an extra space between words makes two strings different. For example, “Blue sky” and “Blue sky ” are not identical, even though the trailing space is difficult to see in a cell. Imported data copied from websites, reports, or other systems may also contain nonbreaking spaces or control characters.

To check the character counts, with the suspect text in A2, enter =LEN(A2). Compare the result with the length of the expected text or another cell. A difference can reveal an extra character, though equal lengths do not prove that the characters are the same.

TRIM removes ordinary leading and trailing spaces and reduces repeated ordinary spaces between words to one. CLEAN removes certain nonprinting control characters. Neither alone removes every character that can look like a normal space: in particular, a nonbreaking space (character 160) can survive both. If the text is imported, replace those spaces as part of the comparison.

With the two strings in A2 and B2, use =EXACT(TRIM(CLEAN(SUBSTITUTE(A2,CHAR(160)," "))),TRIM(CLEAN(SUBSTITUTE(B2,CHAR(160)," ")))) to compare after replacing nonbreaking spaces with ordinary spaces, removing supported control characters, and trimming spaces. This intentionally treats some differences as insignificant. It also changes the comparison rule: if a space is meaningful in your data, do not normalize it away.

For a quick check of the final character, with a nonempty suspect value in A2, use =UNICODE(RIGHT(A2,1)). The result is that character’s Unicode code point; 32 indicates an ordinary space and 160 indicates a nonbreaking space. This checks only the last character, so it will not locate a hidden character in the middle of a string.

Confirm that you are comparing the values you intend

Cells can display the same text while storing different underlying content. One cell might contain a number and another might contain text that looks like that number. Similarly, a date may be displayed in a friendly format while its stored value is a date serial number. EXACT is intended to compare text strings, so do not assume that identical-looking displays guarantee identical underlying inputs.

Check whether a cell contains text by using ISTEXT. With the suspect value in A2, enter =ISTEXT(A2). TRUE means Excel treats the cell value as text; FALSE means it does not. You can also inspect the formula bar, check the source data, or use a consistent conversion approach before comparing. Choose the conversion based on what the data represents: converting an identifier to text may be appropriate, while converting a numeric measurement to text can obscure useful numeric behavior.

Formatting can also hide meaningful differences. For example, a number format may display different stored values with the same number of decimal places, or display a numeric value in a way that resembles text. EXACT does not compare the formatted appearance; verify the stored values and the intended comparison rule instead.

Check the formula, cell references, and result type

Make sure the formula points to the cells you mean to compare. A copied formula may have shifted references, or the formula may be comparing a header, blank cell, or a different row. Click the formula cell and review the references in the formula bar. If you fill a formula down a table, check the first few rows to confirm the references move as intended.

EXACT returns TRUE or FALSE. A cell displaying 0 or 1, or a custom message, may be showing a transformed result rather than the function’s direct output. For example, with the compared values in A2 and B2, =IF(EXACT(A2,B2),1,0) deliberately converts the Boolean result to 1 or 0.

In English-language Excel, arguments are usually separated with commas, as in =EXACT(A2,B2). Some regional settings use semicolons as formula separators. If Excel rejects a formula that otherwise looks correct, follow the separator style Excel uses in formulas on that computer. A leading apostrophe before a formula can also make Excel treat it as text instead of calculating it; remove the apostrophe if the cell is meant to contain a working formula.

If either referenced cell contains an error, the comparison may return an error rather than TRUE or FALSE. Fix the source error first, or decide explicitly how the comparison should handle it. Wrapping a formula in an error-handling function can hide the underlying problem, so use that only when an error result has a defined meaning in your worksheet.

Check calculation and workbook behavior

If the source cells change but the result does not, confirm that Excel is recalculating formulas. In Excel for Microsoft 365 on Windows, choose Formulas > Calculation Options > Automatic. Manual calculation can leave formula results unchanged until recalculation is requested. Excel for Mac has calculation controls on the Formulas tab as well, though exact ribbon layout can vary by release.

On Windows, F9 recalculates formulas in open workbooks, while Ctrl+Alt+F9 forces a full calculation. On a Mac, use Formulas > Calculate Now; whether an F-key shortcut works directly can depend on the keyboard’s function-key settings. Recalculation will not fix a wrong reference or an unwanted hidden space, but it can resolve a stale displayed result.

Also check whether the formula cell is formatted as Text. If Excel displays the formula characters instead of a result, change the cell format to General, then re-enter the formula so Excel evaluates it. Merely changing the format may not convert a formula already stored as text.

Choose the right comparison method

The right method depends on what “equal” means for the task. EXACT is useful when uppercase and lowercase letters matter and every character must match. The equals operator is often better for ordinary text comparisons where capitalization should not matter. Neither method automatically decides whether extra spaces, punctuation, or alternate spellings should count as equivalent; that is a data-cleaning decision.

  • Use EXACT for case-sensitive checks of codes, labels, or text entries where every character matters.
  • Use the equals operator for a simple text comparison that should ignore capitalization.
  • Normalize first only when the task permits ignoring specified differences such as ordinary extra spaces or imported nonbreaking spaces.
  • Use a lookup or search function when the goal is to find a value in a list rather than compare two particular cells. Check the chosen function’s matching rules before relying on it.

For example, a check of customer-entered country names may reasonably ignore capitalization and accidental spaces, while a product identifier may require an exact character-for-character match. Applying cleanup automatically can produce false matches if punctuation or spacing distinguishes valid records.

A practical troubleshooting order

Work through these checks in order so you do not change data unnecessarily:

  1. Confirm the formula references the intended cells and returns TRUE or FALSE directly.
  2. Decide whether capitalization should matter; if it should not, use a case-insensitive comparison instead of EXACT.
  3. Compare character counts and inspect for leading, trailing, repeated, or nonbreaking spaces.
  4. Check whether the inputs are text, numbers, dates, or formula results rather than relying only on their appearance.
  5. Verify the formula separator, cell format, and workbook calculation setting.
  6. Apply only the cleanup rules appropriate to the data, then recheck a few known examples manually.

This order separates a misunderstood comparison rule from a genuine formula or workbook problem. It also reduces the risk of “fixing” a valid difference by stripping characters that carry meaning.

Frequently Asked Questions

Is EXACT case-sensitive in Excel?
Yes. EXACT treats uppercase and lowercase letters as different, so “ABC” and “abc” return FALSE. Use the equals operator for a basic text comparison that should ignore case.

Does EXACT ignore spaces?
No. Leading, trailing, and extra internal spaces count as characters. TRIM can clean ordinary spaces, but nonbreaking spaces may need to be replaced separately.

Does EXACT compare formatting or just cell contents?
It compares the input values as text, not font, color, borders, or number formatting. Two cells that look alike can still contain different characters or underlying values.

Why does EXACT return FALSE when the cells look identical?
Common causes include a hidden space, a nonprinting character, a different letter case, or text stored differently from a number. Check character lengths, inspect the source values, and test only the cleanup rules that fit your data.

Why does Excel show the formula instead of TRUE or FALSE?
The cell may be formatted as Text, the formula may have a leading apostrophe, or the entry may not have been submitted as a formula. Set the cell to General, remove any leading apostrophe, and re-enter the formula.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Errors & fixes

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.