Text functions

EXACT

Matches all 8 recorded answers

Recorded: 8 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicEXACT
BulgarianEXACT
CzechSTEJNÉ
DanishEXACT
GermanIDENTISCH
GreekEXACT
English (Australia)EXACT
English (United Kingdom)EXACT
English (United States)EXACT
SpanishEXACT
EstonianEXACT
FinnishVERTAA
FrenchEXACT
HebrewEXACT
CroatianEXACT
HungarianAZONOS
IndonesianEXACT
ItalianEXACT
JapaneseEXACT
KoreanEXACT
LithuanianEXACT
LatvianEXACT
NorwegianEXACT
DutchGELIJK
PolishPORÓWNAJ
Portuguese (Brazil)EXATO
Portuguese (Portugal)EXATO
RomanianEXACT
RussianФункция СОВПАД
SlovakEXACT
SlovenianEXACT
Serbian (Latin)EXACT
SwedishEXACT
ThaiEXACT
TurkishÖZDEŞ
UkrainianEXACT
VietnameseEXACT
Chinese (Simplified)EXACT
Chinese (Hong Kong)EXACT
Chinese (Traditional)EXACT

Names from Microsoft's support site.

What it does

EXACT(text1, text2)

EXACT compares two text values and returns TRUE if they are the same and FALSE otherwise. Microsoft's article adds the two qualifications that make it a distinct function rather than a synonym for =: the comparison is case-sensitive, and it ignores formatting differences.

Both qualifications are worth stating precisely.

Case-sensitive means EXACT("Word","word") is FALSE, where the equality operator A1="word" would be TRUE for the same pair. This is the whole reason the function exists: Excel's = comparison of text is case-insensitive, and there is no operator that is not.

What the documentation does not say is what "the same" means below the level of characters. Text in the Handbook's value model is a sequence of UTF-16 code units (chapter 01), and two strings can look identical, print identically, and still differ:

  • é as one code point (U+00E9) versus e followed by a combining acute (U+0065 U+0301). These are canonically equivalent under Unicode normalisation and different as code-unit sequences.
  • The same glyph reached through different variation selectors or through compatibility characters.

An implementation that normalises before comparing and one that compares code units answer differently on those inputs. Microsoft's article does not choose; it is the sharpest unresolved question on this page.

Arguments

text1, text2 — both required; the article describes them simply as the first and second text strings. Both are text arguments, so a number or a logical converts to text before comparison. Two consequences readers hit regularly:

  • EXACT(1,"1") compares the text 1 against the text 1. The number's General rendering is what is compared, so this is a comparison of renderings, not of values.
  • EXACT(A1,"") with A1 an empty cell compares empty text against empty text. Empty and empty-string are different value kinds at the call boundary (chapter 01) but they converge here, which is why EXACT cannot distinguish a blank cell from a cell containing ="". Use ISBLANK for that question.

There is no third argument: no locale, no normalisation form, no "ignore whitespace" option.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

Quirks

Result and edge cases

The return kind is Logical — TRUE or FALSE, not 1 or 0, though it converts to those in numeric contexts.

  • Leading and trailing spaces count. Microsoft's own example set includes "w ord" versus "word" as FALSE; a difference in internal spacing is a difference.
  • Two empty texts compare TRUE.
  • The function is symmetric and reflexive on any input it accepts. It is not transitive across coercion boundaries in the way readers assume: EXACT(1,"1") and EXACT("1","1.0") do not compose, because the coercion happens once, on entry.

Errors

The article lists no error conditions of the function's own. Reachable errors are the shared ones: an error value in either argument propagates (chapter 02), and a value kind with no text conversion surfaces #VALUE! under the shared coercion rules.

Note the asymmetry with the comparison operator: ="a"="a" never errors, while EXACT inherits the whole coercion pipeline and therefore can.

How to implement

Notes for implementers

  1. Pick a comparison level and declare it. Code-unit equality, code-point equality, NFC-then- compare, and full case-sensitive collation are four different functions. They agree on ASCII, so ASCII tests cannot distinguish them.
  2. Do not use a locale collator. Collation is designed to make visually-equivalent strings compare equal and is exactly the wrong tool here; EXACT is a sameness test, not an ordering.
  3. Ill-formed UTF-16 must not panic. The value-universe chapter records lone surrogates as a reachable state in Excel text, so the comparison has to be defined over raw code units even if the rest of the implementation decodes.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

EXACT · 5 lines · calc-func/src/catalogue/text_functions.rs on GitHub
19 exact_fn "EXACT" (2, 2) [V "text1", V "text2"] |s, a, sv| {
    let left = text_arg(s, a, 0)?;
    let right = text_arg(s, a, 1)?;
    Ok(CalcValue::logical(left.utf16_code_units() == right.utf16_code_units()))
}

Kernels shared with other functions

Argument and result plumbing

No implementation has been published with a Handbook test suite for this function.

Version differences

No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.

Alternatives

Relationships

  • = (the equality operator, FUNC.OP_EQ) is the case-insensitive counterpart. Choosing between them is the single most common reason to reach for EXACT.
  • FIND / SEARCH carry the same case-sensitivity split for substring search: FIND is case-sensitive, SEARCH is not. EXACT is to = as FIND is to SEARCH.
  • LOWER / UPPER are the usual way to build a case-insensitive comparison explicitly. Note that EXACT(LOWER(a),LOWER(b)) and a=b are not the same predicate — case folding merges pairs that Excel's own comparison may or may not merge.
  • DELTA is the numeric analogue (equality as a returned value rather than a branch), for numbers rather than text.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents