Compare cell contents against string in Excel
133,950
Solution 1
You can use the EXACT
Function for exact string comparisons.
=IF(EXACT(A1, "ENG"), 1, 0)
Solution 2
If a case-insensitive comparison is acceptable, just use =
:
=IF(A1="ENG",1,0)
Author by
Pr0no
Updated on July 23, 2022Comments
-
Pr0no almost 2 years
Consider the following:
A B 1 ENG 1 2 ENG 1 3 FRA 0 4 FOO 0
I need a formula to populate the
B
column with1
if theA
column contains the stringENG
, or0
otherwise.I've tried (in cell B1)
=IF(A1=(TEXT(ENG;FALSE));1;0)
but then it says#NAME?
in the cell. PuttingENG
between quotation marks doesn't help either. What should my formula be like?