In Excel: use =EXACT(text1, text2) — it compares two values case-SENSITIVELY, where the = operator does not.
On this page8
Syntax
Arguments
| Argument | required / optional | Description |
|---|---|---|
text1 | required | The first value to compare. |
text2 | required | The second value. Comparison is case-sensitive. |
Related functions
Select the result cell and type =EXACT(.
Select the first value, add a comma, then the second.
Press Enter — TRUE means an exact character-for-character match.
For a case-sensitive lookup, nest it inside MATCH against TRUE.
What this does
EXACT compares two text values and returns TRUE only if they match character for character, including case. That matters because Excel's own = operator is case-insensitive: "ABC"="abc" returns TRUE, which surprises anyone coming from a database. Wherever case carries meaning — product codes, passwords, case-sensitive identifiers from an external system — EXACT is the only comparison that tells the truth. Combined with SUMPRODUCT it also powers a case-sensitive lookup, which VLOOKUP and XLOOKUP cannot do at all. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. For “exact function in excel”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected formula change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a calculation you can defend to a CFO or an auditor useful in real work: repeatable, auditable, and not dependent on memory or luck.
A worked example
Comparing two code columns where case matters: =EXACT(A2, B2) returns FALSE for "AB-1024" against "ab-1024", where =A2=B2 returns TRUE. A case-sensitive lookup: =INDEX(C2:C500, MATCH(TRUE, EXACT(A2:A500, "AB-1024"), 0)). Counting exact matches: =SUMPRODUCT(--EXACT(A2:A500, "Active")). EXACT is the only truthful comparison when case carries meaning, and Excel's default operator quietly does not. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.
In Google Sheets
Google Sheets support for this task has not been verified. Check the function, arguments and workflow in the target product before transferring the example. Matching formula notation does not establish identical behaviour. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. For “exact function in excel”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.
Common mistakes
- Assuming = is case-sensitive; it is not, which is precisely why EXACT exists.
- Comparing values with different trailing whitespace and blaming case — wrap both in
TRIMfirst. - Expecting EXACT to ignore formatting differences; it compares the underlying values only.
Frequently asked questions
Is Excel's = operator case-sensitive?
No. "ABC"="abc" returns TRUE. Use EXACT when case must match.
How do I do a case-sensitive VLOOKUP?
Neither VLOOKUP nor XLOOKUP can. Use =INDEX(result, MATCH(TRUE, EXACT(lookup_range, value), 0)).
Why does EXACT return FALSE on values that look identical?
Almost always trailing whitespace. Compare =LEN of each to confirm, then TRIM both sides.