I discovered (when answering this question) that string comparison in filter
is case insensitive: the formulas =filter(A:A, B:B = "Yes")
and =filter(A:A, B:B = "YES")
have the same output.
Apparently, this is true generally for string comparison in Google Sheets: ="Y"="y"
returns TRUE, and so does its equivalent =eq("Y", "y")
.
This is convenient sometimes, but what to do when I want to filter rows by case-sensitive string equality?
Best Answer
Short answer
Use
REGEXMATCH(text, regular_expression)
instead of=
orEQ(value1,value2)
to set the conditions forFILTER(range,condition1,[condition2, ...])
Demostration
Data source
Formula in D1
(The word is placed between ^ and $, so that the entire cell content is required to match it.)
Result