# EXACT in Google Sheets: syntax and examples

URL: https://goingstellar.ro/reference/sheets/exact/

EXACT returns TRUE only when both texts match character by character, with the same case. The = operator ignores case, so use EXACT for passwords, codes and any comparison where A and a are different.

## Syntax

```
EXACT(string1, string2)
```

## Arguments

- `string1` (string, required: yes): The first text.
- `string2` (string, required: yes): The second text, compared with string1.

## Examples

The examples use this table, starting in A1:

| Code | Typed |
|---|---|
| AB-1 | AB-1 |
| ab-1 | AB-1 |
| AB-1  | AB-1 |
| Zebra | Zebra |

```
=EXACT(A2,B2)
```

Result: `TRUE`

Identical texts return TRUE. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=EXACT(A3,B3)
```

Result: `FALSE`

Only the case differs and the result is FALSE. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=A3=B3
```

Result: `TRUE`

For contrast: the equals operator ignores case, so this is TRUE. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=EXACT(A4,B4)
```

Result: `FALSE`

A trailing space makes the texts different. Run in a Google Sheet (English US locale) on 2026-11-29.

```
=EXACT(TRIM(A4),B4)
```

Result: `TRUE`

TRIM removes the extra space, then the texts match. Run in a Google Sheet (English US locale) on 2026-11-29.

## Common errors

- EXACT is case sensitive, while = is not. "ab-1" = "AB-1" is TRUE, but EXACT on the same pair is FALSE.
- Invisible differences count. A trailing space makes the pair FALSE. Wrap one side in TRIM, as in the examples.
- A range in a plain formula returns #VALUE!. Use ARRAYFORMULA to compare two columns row by row.
- A number and the same digits as text are equal: EXACT(123,"123") is TRUE.

## Compared with Excel

Same syntax in Excel.

## Used in recipes

- [How to highlight duplicates in Google Sheets](https://goingstellar.ro/reference/sheets/recipes/highlight-duplicates/)

## Related functions

- [UPPER](https://goingstellar.ro/reference/sheets/upper/)
- [LOWER](https://goingstellar.ro/reference/sheets/lower/)
- [TRIM](https://goingstellar.ro/reference/sheets/trim/)
- [IF](https://goingstellar.ro/reference/sheets/if/)
- [CONCATENATE](https://goingstellar.ro/reference/sheets/concatenate/)
- [FIND](https://goingstellar.ro/reference/sheets/find/)

## Sources

- [EXACT (Docs Editors Help)](https://support.google.com/docs/answer/3094073)

