Back to functions
Text2026-06-081 related article

EXACT Function in Excel

Compare two text strings and return TRUE only when they match exactly.

Syntax

EXACT(text1, text2)

Arguments

text1

Required

The first text string or cell reference to compare.

text2

Required

The second text string or cell reference to compare.

What it returns

Returns TRUE when both text values are exactly the same, and FALSE otherwise.

What EXACT does

EXACT compares two text values and returns TRUE only when the characters match exactly. It is case-sensitive, so ABC and abc are different.

Use EXACT when normal equality checks are too loose for the task, such as product codes, IDs, imported labels, or passwords where letter case matters.

Practical examples

Compare two cells with case sensitivity

=EXACT(A2,B2)

If both cells contain the same characters in the same case, the result is TRUE. If one cell contains SKU-101 and the other contains sku-101, the result is FALSE.

Return a readable match label

=IF(EXACT(A2,B2),"Exact match","Different")

This wraps the TRUE/FALSE result in labels that are easier to scan in a worksheet.

Common mistakes and notes

EXACT is case-sensitive

This is the main reason to use the function. If case should not matter, use a normal comparison such as =A2=B2 instead.

Formatting does not make values different

EXACT compares the text values, not the visual formatting. A bold value and a regular value can still be an exact match.

Extra spaces count

If one value has a leading, trailing, or repeated space, EXACT returns FALSE. Use TRIM first when imported data may contain unwanted spaces.

Related functions

Related articles

Deep dives, troubleshooting guides, and practical examples that use EXACT.

Official documentation