EXACT function

EXACT returns TRUE if two text strings are exactly the same, including case, and FALSE otherwise, making it ideal for case-sensitive comparisons.

=EXACT(text1, text2)

Generate a EXACT formula

Describe what you need. The generator will reach for EXACT where EXACT is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How EXACT reads its arguments
text1requiredtext2requiredEXACT
ArgumentRequiredDescription
text1RequiredThe first text value to compare; can be a string, cell reference, or range – non-text values are coerced to text.
text2RequiredThe second text value to compare; must be the same type as text1 – mismatched array dimensions cause an error.

Returns

A Boolean value (TRUE or FALSE) returned as a single cell or an array of Booleans.

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Check if a student name matches exactly

StudentSubjectAssignmentScoreMax Score
AliceMathTest185100
BobMathTest185100
aliceScienceLab190100
=EXACT(A2, "Alice")

Result: TRUE

Cell A2 contains the text "Alice" with a capital A. EXACT compares it to the literal string "Alice" and finds an exact match, including case, so it returns TRUE. If the cell had "alice" (lower-case), the result would be FALSE because EXACT is case-sensitive.

2. Validate a combined student-subject label

StudentSubjectAssignmentScoreMax Score
AliceMathTest185100
BobMathTest185100
aliceScienceLab190100
=EXACT(CONCAT(A2, " ", B2), "Alice Math")

Result: TRUE

CONCAT merges the student name in A2 ("Alice") with a space and the subject in B2 ("Math") to produce "Alice Math". EXACT then compares this result with the same literal string and finds an exact, case-identical match, returning TRUE. Changing either the case or the spacing would cause FALSE.

3. Flag a case mismatch in a lookup column

StudentSubjectAssignmentScoreMax Score
AliceMathTest185100
BobMathTest185100
aliceScienceLab190100
=IF(EXACT(A3, "Alice"), "Match", "No match")

Result: No match

Row 3 contains the lowercase name "alice". EXACT compares it to "Alice" and, because the case differs, returns FALSE. The IF wrapper translates that FALSE into the text "No match", letting you quickly spot entries that do not match the expected capitalization.

Common errors

Which EXACT error are you seeing?
EXACT returned an error#VALUE!
Adjust the ranges so they cover the same number of rows and columns, or compare single cells instead of mismatched arrays.
#N/A
Wrap the call in IFERROR or IFNA, e.g., =IFERROR(EXACT(A5, "Bob"), FALSE), to handle the error gracefully.
#REF!
Correct the cell reference to point to a valid location, or restore the deleted column/row.
ErrorWhy it happensHow to fix it
#VALUE!EXACT was given two ranges of different dimensions, e.g., =EXACT(A2:A4, B2:B3). The function cannot align the arrays element-wise.Adjust the ranges so they cover the same number of rows and columns, or compare single cells instead of mismatched arrays.
#N/AOne of the referenced cells contains a #N/A error, such as =EXACT(A5, "Bob") when A5 is #N/A. EXACT propagates the error instead of returning TRUE/FALSE.Wrap the call in IFERROR or IFNA, e.g., =IFERROR(EXACT(A5, "Bob"), FALSE), to handle the error gracefully.
#REF!The formula refers to a cell that no longer exists, for example =EXACT(A2, Z1) after column Z was deleted. Excel/Sheets cannot resolve the reference.Correct the cell reference to point to a valid location, or restore the deleted column/row.

Tips and when to use something else

  • Use EXACT when you need case-sensitive matching; the plain = operator ignores case.
  • Combine EXACT with IF to create conditional flags for data validation.
  • If you only need to test for equality without caring about case, use the = operator or the LOWER/UPPER functions first.
  • When comparing large lists, wrap EXACT in an array formula (Ctrl+Shift+Enter in older Excel) to get a column of TRUE/FALSE results.

Frequently asked questions

How does EXACT differ from the = operator in Excel?
The = operator performs a case-insensitive comparison, so "Alice" = "alice" returns TRUE. EXACT, on the other hand, is case-sensitive and will return FALSE unless the text matches exactly, including uppercase and lowercase characters.
Can EXACT compare whole ranges at once?
Yes. In both Excel and Google Sheets, if you pass two equally-sized ranges, EXACT returns an array of Boolean values, each indicating whether the corresponding cells match exactly. The ranges must be the same size, otherwise you get a #VALUE! error.
Why does EXACT return #VALUE! when I compare two columns of different length?
EXACT expects the two arguments to be comparable element-by-element. When the dimensions differ, the function cannot align the cells and therefore signals the mismatch with a #VALUE! error. Make the ranges the same size or compare single cells to avoid this.
How can I ignore leading/trailing spaces when using EXACT?
Wrap each argument with TRIM before calling EXACT, e.g., =EXACT(TRIM(A2), TRIM("Alice")), which removes extra spaces so the comparison focuses only on the core characters.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17