ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Comparisons
  3. EXACT vs = in Excel: Case-Sensitive Comparisons

EXACT vs = in Excel: Case-Sensitive Comparisons

By ExcelReady Team·Updated November 1, 2026·7 min read

The short answer

The equals sign compares two values without caring about case, so ="apple"="APPLE" returns TRUE. EXACT compares two text strings character by character, including case, so =EXACT("apple","APPLE") returns FALSE. Use = for everyday checks, and EXACT when capital letters matter, such as product codes, passwords or IDs.

Key takeaways

  • =A2=B2 is not case-sensitive; =EXACT(A2,B2) is.
  • Both treat extra spaces as differences, so clean data with TRIM first.
  • COUNTIF, MATCH, VLOOKUP and XLOOKUP are all case-insensitive; combine them with EXACT for case-sensitive results.
  • =SUMPRODUCT(--EXACT(A2:A7,"AB-100")) counts exact, case-matching entries.
On this page+
  1. EXACT vs = at a glance
  2. How the equals sign compares values
  3. How EXACT compares text
  4. The same codes checked both ways
  5. When to use =
  6. When to use EXACT
  7. Common mistakes when comparing text
  8. Our recommendation
  9. Practise it

The short answer to EXACT vs equals in Excel: the equals sign (=) compares values without caring about upper and lower case, while the EXACT function compares text including case. So ="apple"="APPLE" returns TRUE, but =EXACT("apple","APPLE") returns FALSE. This comparison is for anyone checking codes, IDs or names where capital letters matter, and for anyone puzzled by a match that "should" have failed.

EXACT vs = at a glance#

The equals sign is a quick, case-blind comparison; EXACT is a strict, case-aware one.

Feature= (equals)EXACT
Syntax=A2=B2=EXACT(A2,B2)
ResultTRUE or FALSETRUE or FALSE
"apple" vs "APPLE"TRUEFALSE
Extra space ("AB-100 " vs "AB-100")FALSEFALSE
Number 1 vs text "1"FALSETRUE (compares as text)
Formatting (bold, colour)IgnoredIgnored
Compares a range in one goYes, in array formulasYes, in array formulas
Used inside COUNTIF, MATCH, lookupsBuilt in, case-blindCombine with SUMPRODUCT, MATCH or XLOOKUP
Excel versionsAll versionsAll versions

How the equals sign compares values#

Typing =A2=B2 in a cell compares the two values and returns TRUE or FALSE. It is a comparison operator, like > or <.

Excel formula
=A2=B2
=IF(A2=B2,"Match","Check")

For text, the comparison ignores case: Excel, EXCEL and excel are all equal. It does not ignore spaces, so "Excel " with a trailing space is different. For numbers, it compares values, so 5 equals 5.0. A number never equals text, so the number 1 and the text "1" are not equal. The TRUE and FALSE comparisons lesson practises all the comparison operators.

Every criteria-based function in Excel, including COUNTIF, SUMIF, MATCH, VLOOKUP and XLOOKUP, compares text the same case-blind way.

How EXACT compares text#

EXACT takes two values, converts them to text, and returns TRUE only if every character matches, including case.

Excel formula
=EXACT(A2,B2)
=EXACT("AB-100","ab-100")

The second formula returns FALSE because the letters differ in case. Because EXACT compares text, the number 1 and the text "1" count as the same, which is the opposite of =. Formatting doesn't matter: a bold "Paid" matches a plain "Paid". The guide to case-sensitive matching with EXACT covers more uses.

The same codes checked both ways#

Here are product codes typed by six clerks. The correct code is AB-100.

AB=A2="AB-100"=EXACT(A2,"AB-100")
2AB-100AnaTRUETRUE
3ab-100BenTRUEFALSE
4AB-100ChloeTRUETRUE
5Ab-100DevTRUEFALSE
6AB-100 (with a trailing space)EmaFALSEFALSE
7AB-101FinnFALSEFALSE

The equals sign accepts four codes, because it ignores case. EXACT accepts only two. Row 6 fails both tests, because the trailing space is a real character, even though you can't see it.

Counting the matches#

Excel formula
=COUNTIF(A2:A7,"AB-100")
=SUMPRODUCT(--EXACT(A2:A7,"AB-100"))

COUNTIF returns 4: it is case-blind, just like =. The SUMPRODUCT version returns 2. EXACT checks each cell and returns a list of TRUE and FALSE values; the double minus (--) turns them into 1s and 0s; and SUMPRODUCT adds them up.

Looking up a case-sensitive value#

Suppose A2:A6 holds codes such as ab-1 and AB-1 that differ only by case, and B2:B6 holds prices. To return the price for the code in E2, matching case:

Excel formula
=XLOOKUP(TRUE,EXACT(A2:A6,E2),B2:B6)
=INDEX(B2:B6,MATCH(TRUE,EXACT(A2:A6,E2),0))

EXACT builds a TRUE/FALSE list, and the lookup finds the first TRUE. XLOOKUP needs Excel 2021 or Microsoft 365. The INDEX MATCH version works everywhere; in Excel 2019 and earlier, confirm it with Ctrl+Shift+Enter (⌘+Shift+Return on a Mac). Note that "exact match" in VLOOKUP means "not approximate", not "case-sensitive"; see VLOOKUP exact match.

Comparing two whole lists#

EXACT also works across two columns at once. If A2:A7 holds codes from one system and B2:B7 holds the same codes from another, this counts the rows that match perfectly:

Excel formula
=SUMPRODUCT(--EXACT(A2:A7,B2:B7))

To see which rows differ, select A2:B7, choose Home > Conditional Formatting > New Rule > Use a formula, and enter =NOT(EXACT($A2,$B2)). Every row where the two codes differ in any way, including case and spaces, is highlighted. The dollar signs lock the columns, so the rule checks each row against its own pair.

Other functions that care about case#

EXACT isn't the only case-sensitive function. FIND is case-sensitive, while SEARCH is not: =FIND("ab","AB-100") returns #VALUE!, but =SEARCH("ab","AB-100") returns 1. SUBSTITUTE is case-sensitive too, so =SUBSTITUTE(A2,"ab","XY") leaves "AB" untouched. Knowing which functions respect case helps you avoid surprises when cleaning text.

When to use =#

Use the equals sign for everyday comparisons. It fits:

  • Names, categories and statuses, where "north" and "North" should count as the same.
  • IF tests, such as =IF(C2="Paid","Done","Chase").
  • Comparing numbers and dates, where case doesn't apply.
  • Checking two lists match after you've cleaned them, such as =A2=B2 filled down.
  • Data validation and conditional formatting rules, such as highlighting rows where a status equals "Overdue", whatever case people type it in.
  • Job test questions that ask whether two cells hold the same value. Unless the task mentions case, the equals sign is the expected answer.

When to use EXACT#

Use EXACT when upper and lower case carry meaning. It fits:

  • Product codes, SKUs and part numbers where ab-100 and AB-100 are different items.
  • Case-sensitive IDs and usernames in exported system data.
  • Auditing data entry, to find codes typed in the wrong case before an import.
  • Case-sensitive counts and lookups, combined with SUMPRODUCT, MATCH or XLOOKUP.
  • Detecting invisible differences, since EXACT and LEN together show when two cells only look the same.
  • Reconciling exports from two systems, where one system stores codes in capitals and another doesn't, and you need to know exactly which records were changed.

Common mistakes when comparing text#

  1. Expecting = to catch case differences. It never does. Use EXACT.
  2. Forgetting about spaces. Both tests fail on a trailing space. Clean first with TRIM; the comparison of TRIM vs CLEAN explains which removes what.
  3. Using EXACT inside COUNTIF. COUNTIF doesn't accept a function as its criteria range. Use SUMPRODUCT with EXACT.
  4. Comparing numbers stored as text with =. =A2=B2 returns FALSE for 100 and "100". Convert with VALUE, or compare with EXACT if you only care about the characters.
  5. Assuming "exact match" means case-sensitive. In VLOOKUP and MATCH, exact match still ignores case.
  6. Fixing case by hand. If case doesn't matter, standardise it with UPPER or LOWER instead of checking with EXACT. For other text fixes, see SUBSTITUTE vs REPLACE and the guide to cleaning messy data.

Our recommendation#

Use the equals sign by default. Most comparisons in real work, from statuses to names, should ignore case, and = is short and familiar. Switch to EXACT only when capital letters change the meaning, such as codes, IDs or usernames, and pair it with SUMPRODUCT, MATCH or XLOOKUP for counts and lookups. Whichever you use, run TRIM on imported text first, because a hidden space fails both tests.

In short: = when case doesn't matter, EXACT when it does, and TRIM before either.

Practise it#

Try the exercise on this page: count codes that match AB-100 exactly, case and all. Then practise TRUE and FALSE comparisons in a live spreadsheet and the cleaning text lesson: you type each formula, and it checks your answer instantly.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

Column A holds product codes typed by different clerks. In D2, count how many match AB-100 exactly, including capital letters, using SUMPRODUCT and EXACT.

fx
ABCDE
1
Code entered
Clerk
2
AB-100
Ana
Exact AB-100
3
ab-100
Ben
4
AB-100
Chloe
5
Ab-100
Dev
6
AB-100
Ema
7
AB-101
Finn
8
9
10

Tip: EXACT(A2:A7,"AB-100") checks every cell. Put -- in front to turn TRUE into 1, then wrap it in SUMPRODUCT to add them up.

Practise this in a lesson

LessonTRUE, FALSE and comparisonsAsk Excel yes-or-no questions with =, <>, >, <, >= and <=, and get TRUE or FALSE back. The building block of every IF.LessonCleaning messy textFix stray spaces, random capitals and inconsistent separators in imported data with TRIM, PROPER, UPPER, LOWER and SUBSTITUTE.

Frequently asked questions

Is the equals sign in Excel case-sensitive?

+

No. =A2=B2 returns TRUE for "Excel" and "EXCEL". Use =EXACT(A2,B2) when you need upper and lower case to count as different.

What does the EXACT function do in Excel?

+

EXACT compares two text strings and returns TRUE only if they are identical, including upper and lower case and every space. It ignores formatting such as bold or colour.

How do I do a case-sensitive lookup in Excel?

+

Combine a lookup with EXACT, such as =XLOOKUP(TRUE,EXACT(A2:A6,E2),B2:B6) in Excel 2021 or Microsoft 365, or =INDEX(B2:B6,MATCH(TRUE,EXACT(A2:A6,E2),0)) in older versions, entered with Ctrl+Shift+Enter there.

Why does EXACT return FALSE when the cells look the same?

+

Usually one cell has an extra space or a hidden character, often from pasted or imported data. Check with LEN, and clean the text with TRIM or CLEAN before comparing.

How do I count case-sensitive matches in Excel?

+

Use =SUMPRODUCT(--EXACT(A2:A7,"AB-100")). EXACT checks each cell, the double minus turns TRUE and FALSE into 1 and 0, and SUMPRODUCT adds them.

Sources

  • EXACT function - Microsoft Support
  • Calculation operators and precedence in Excel - Microsoft Support
  • TRIM function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. EXACT vs = at a glance
  2. How the equals sign compares values
  3. How EXACT compares text
  4. The same codes checked both ways
  5. When to use =
  6. When to use EXACT
  7. Common mistakes when comparing text
  8. Our recommendation
  9. Practise it

Keep reading

Text· 6 min read

Case-Sensitive Matching in Excel With EXACT

EXACT compares two values and returns TRUE only when they match character for character, capitals included: =EXACT(A2,B2). The equals sign, VLOOKUP, XLOOKUP and COUNTIF all ignore case, so "ab-1" and "AB-1" count as the same. Use EXACT inside IF, SUMPRODUCT or XLOOKUP when capitals matter.

Comparisons· 7 min read

SUBSTITUTE vs REPLACE in Excel

Use SUBSTITUTE when you know what text to change, such as every dot in a phone number: =SUBSTITUTE(A2,".","-"). Use REPLACE when you know where the text is, such as the first 3 characters of a code: =REPLACE(A2,1,3,"NEW"). SUBSTITUTE works by content and REPLACE works by position.

Comparisons· 7 min read

TRIM vs CLEAN in Excel

TRIM removes extra spaces: every space at the start and end, and all but one space between words. CLEAN removes non-printing characters with codes 0 to 31, such as line breaks and tabs. Use TRIM for spacing problems, CLEAN for hidden characters, and =TRIM(CLEAN(A2)) when imported text has both.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free