EXACT Function (LibreOffice Calc)

Text Beginner LibreOffice Calc LibreOffice 3.0

The EXACT function compares two text strings and returns TRUE if they are exactly the same, including case. It is used for strict text validation, data cleaning, and case-sensitive comparisons.

The **EXACT** function performs a **strict, case‑sensitive text comparison**. It returns **TRUE** only if both strings match exactly, including case, length, and characters.

What the EXACT Function Does

  • Compares two text strings
  • Returns TRUE if they match exactly
  • Returns FALSE if they differ in any way
  • Case‑sensitive
  • Useful for data validation, cleaning, and strict matching

Syntax

EXACT(text1; text2)

Arguments

  • text1:
    First text string.

  • text2:
    Second text string.

Basic Examples

Case‑sensitive comparison

=EXACT("Nick"; "Nick")
→ TRUE

=EXACT("Nick"; "nick")
→ FALSE

Compare cell values

=EXACT(A1; B1)

Compare numbers as text

=EXACT("123"; "123")
→ TRUE

=EXACT("123"; "0123")
→ FALSE

Advanced Examples

Validate user input

=IF(EXACT(A1; "YES"); "Confirmed"; "Invalid")

Detect trailing spaces

=EXACT(A1; TRIM(A1))
→ FALSE if extra spaces exist

Case‑sensitive password or code check

=EXACT(A1; B1)

Use EXACT in array validation

=SUMPRODUCT(EXACT(A1:A10; "OK"))

Compare normalized text

=EXACT(LOWER(A1); LOWER(B1))

Detect invisible characters

=EXACT(A1; CLEAN(A1))

Edge Cases and Behavior Details

EXACT returns TRUE or FALSE

Behavior details

  • Case‑sensitive
  • Treats numbers as text if quoted
  • Empty strings compare normally
  • Whitespace differences matter
  • EXACT(“A”; “A “) → FALSE

Invalid input → coerced to text

No error unless references are invalid.

Common Errors and Fixes

Unexpected FALSE

Cause:

  • Case mismatch
  • Trailing spaces
  • Hidden characters
  • Different encodings

Fix:

  • Use TRIM(), CLEAN(), LOWER(), UPPER()

Comparing numbers vs text

Cause:

  • EXACT(“5”; 5) → FALSE

Fix:

  • Convert both to text or both to numbers

Best Practices

  • Use EXACT for strict text validation
  • Use LOWER/UPPER when case‑insensitive comparison is desired
  • Clean data before comparison (TRIM, CLEAN)
  • Use EXACT in data‑cleaning pipelines to detect anomalies
  • Document comparison rules in models
EXACT is your precision tool for text comparison — perfect for validation, cleaning, and any workflow where “almost equal” isn’t good enough.
  • =A1=B1 — case‑insensitive comparison
  • FIND — case‑sensitive substring search
  • SEARCH — case‑insensitive substring search
  • TRIM / CLEAN — text normalization
  • LOWER / UPPER — case normalization

By mastering EXACT, you can build robust, reliable text‑validation and data‑cleaning workflows in LibreOffice Calc.


Reproducible example (tested in LibreOffice Calc)

This standalone example was calculated in LibreOffice Calc 25.2.3.2 and matched the expected value. It is a practical cross-check of one usage, not proof that every example elsewhere on this page is correct.

=EXACT("Calc";"calc")

Expected result: FALSE.

Compare case-sensitive text values.

If the result differs, check the referenced cells, argument separators and number formatting. For more information, consult the LibreOffice Calc official help.