Google Sheets EXACT Function: How to Use It
In this article
The EXACT function in Google Sheets compares two text values and returns TRUE only if they match exactly — including capitalization, spaces, and any hidden characters. It is the strictest comparison tool in Sheets, and using it takes just one formula: =EXACT(A1, B1). You need nothing special to use it — just a Google account and a spreadsheet.
What You'll Need
- A Google account and access to Google Sheets
- A spreadsheet with two cells (or two text strings) you want to compare
- Basic familiarity with typing formulas into cells
Step-by-Step
- Open your spreadsheet at sheets.google.com and select the sheet containing the values you want to compare.
- Click the empty cell where you want the result to appear.
- Type an equals sign followed by the function name and an opening parenthesis:
=EXACT( - Enter the first value. This can be a cell reference such as
A1, or a text string in quotes such as"Hello". - Type a comma, then enter the second value, again as a cell reference or a quoted string:
=EXACT(A1, B1) - Close the parenthesis and press Enter (or Return on Mac).
- Check the result. The cell shows TRUE if the two values are identical in every character, and FALSE if they differ in any way — capitalization, extra spaces, or different characters.
- To compare many rows at once, click the cell with your formula, then drag the small blue square (the fill handle) at the bottom-right corner of the cell down the column. The cell references adjust automatically for each row.
- To convert TRUE/FALSE into readable words, wrap EXACT in IF:
=IF(EXACT(A1, B1), "Match", "No match") - To compare against text typed directly into the formula, keep the quotes:
=EXACT(A1, "Paid")returns TRUE only for "Paid", not "paid" or "PAID".
Tip: the steps above are identical on desktop and in the mobile Sheets app, though on mobile you type formulas into the formula bar that appears above the keyboard.
Common Mistakes
- Forgetting the quotes around text.
=EXACT(Hello, A1)produces an error because Sheets treats Hello as an undefined name. Write"Hello"instead. - Ignoring trailing spaces. A cell containing "Yes " (with a trailing space) will not match "Yes". This is the most common reason EXACT returns FALSE when values look identical.
- Comparing numbers stored as text. If one cell contains the number 123 and another contains the text "123", EXACT treats them differently and returns FALSE.
- Using EXACT when case doesn't matter. If you only care about the letters regardless of capitalization, use
=A1=B1instead, which is case-insensitive. - Not fixing the range when copying. If you compare every row against one fixed cell, lock it with dollar signs:
=EXACT(A1, $D$1).
Tips
- Combine EXACT with TRIM to ignore accidental leading or trailing spaces:
=EXACT(TRIM(A1), TRIM(B1)) - Pair it with conditional formatting: create a custom formula rule
=EXACT($A1, $B1)to highlight matching or mismatching rows visually. - Use it to validate data entry where capitalization carries meaning — for example, product codes, usernames, or IDs where "ab12" and "AB12" are genuinely different.
- EXACT works inside ARRAYFORMULA:
=ARRAYFORMULA(EXACT(A1:A10, B1:B10))compares whole columns without dragging. - Remember EXACT returns TRUE or FALSE — a boolean value — which you can feed directly into IF, FILTER, or COUNTIF-style logic (wrap in IF to count:
=SUMPRODUCT(--EXACT(A1:A10, B1:B10))).
Troubleshooting
- Formula shows as plain text instead of a result. The cell is probably formatted as plain text. Select the cell, open Format > Number, choose Automatic, then re-enter the formula.
- You see #NAME? error. Check the spelling of EXACT and make sure any literal text is wrapped in double quotes.
- You see #VALUE! or #N/A. One of the referenced cells likely contains an error. Inspect both referenced cells and fix the underlying error first.
- It returns FALSE but the values look the same. Hidden spaces or different capitalization are almost always the cause. Wrap both arguments in TRIM, or test with
=LEN(A1)and=LEN(B1)to compare character counts and spot invisible characters. - The formula returns TRUE/FALSE as text. If you typed the words into the cell instead of a formula starting with =, re-enter it beginning with the equals sign.
Frequently Asked Questions
What does EXACT do in Google Sheets?
It compares two text strings and returns TRUE if they are identical in every character, including case and spaces, and FALSE if they differ in any way.
Is EXACT case-sensitive?
Yes. That is its main purpose. "Sheet" and "sheet" are treated as different values, so EXACT returns FALSE for that pair.
What is the difference between EXACT and the = operator?
The = comparison ignores capitalization, so ="abc"="ABC" returns TRUE. EXACT is stricter and returns FALSE for the same comparison.
Does EXACT work with numbers?
It compares them as text. Two cells containing the same number return TRUE, but a number and the same digits stored as text return FALSE.
How do I make EXACT ignore spaces?
Wrap each argument in TRIM: =EXACT(TRIM(A1), TRIM(B1)) removes leading and trailing spaces before comparing.
Can EXACT compare a whole column at once?
Yes. Use =ARRAYFORMULA(EXACT(A1:A100, B1:B100)) or drag the fill handle to copy the formula down.