Arte SheetsLearn. Try. Understand.

Lookup & Reference

Match Long Text Over 255 Characters (EXACT + XLOOKUP Bypass for Deep URLs & Clauses)

Bypass legacy 255-character lookup limits and prefix collisions when matching long tracking URLs, API payloads, and contract clauses that differ only after character 255.

Why legacy MATCH and COUNTIF fail past character 255

Classic Excel MATCH raises #VALUE! when lookup_value exceeds 255 characters, and COUNTIF can fail or conflate long strings sharing an identical 255-character prefix—a common trap when matching full marketing landing URLs whose utm_content token sits past character 260.

Comparing the full string byte-for-byte with EXACT(Range, Target) produces a boolean TRUE/FALSE array of arbitrary string length (up to 32,767 characters per cell), allowing XLOOKUP(TRUE, EXACT(Range, Target), Return_Range, "NO_MATCH") and SUMPRODUCT(--EXACT(Range, Target)) to resolve deep suffix differences accurately.

String LengthDifference PositionLegacy MATCH / COUNTIFEXACT + XLOOKUP
120 charsChar 80Works (case-insensitive)Works (case-sensitive)
263 charsChar 263 ("-v1" vs "-v2")#VALUE! or false tieExact match ("DOC-102")
263 charsCase change at char 262Cannot distinguishDistinguishes "-V2" vs "-v2"

Full-Length Exact Lookup Past 255 Characters

Evaluate per-row EXACT(A2, $E$3) so every character beyond position 255 participates in a case-sensitive comparison, then look up TRUE with XLOOKUP.

=XLOOKUP(TRUE, C2:C4, B2:B4, "NO_MATCH")

Count Long-Text Matches Without COUNTIF Truncation

Count TRUE flags in the per-row EXACT column to count long-string matches reliably without 255-character wildcard truncation.

=COUNTIF(C2:C4, TRUE)

Try the example

Use the original values or change them to test your understanding.

Further reading