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 with 1
if the A
column contains the string ENG
, or 0
otherwise.
I've tried (in cell B1) =IF(A1=(TEXT(ENG;FALSE));1;0)
but then it says #NAME?
in the cell. Putting ENG
between quotation marks doesn't help either. What should my formula be like?
Start a formula with =IF( and enter the two cell locations, separated by an equal sign. Add a comma and enter the text, in quotes, to display if the cells match. Add another comma and then the text, in quotes, for a non-match. For example, the formula could read =IF(A1=B1,"Match","No Match") to compare cells A1 and B1.
You can use the EXACT
Function for exact string comparisons.
=IF(EXACT(A1, "ENG"), 1, 0)
If a case-insensitive comparison is acceptable, just use =
:
=IF(A1="ENG",1,0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With