What to do when if contains text
Tutor 5 (50 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
An IF formula checks whether a text condition is true or false. Excel evaluates text by comparing the exact characters in the referenced cell to the text value inside the formula.
How to check if a cell contains text
To check text, Excel uses logical comparisons along with the SEARCH or FIND function.
1. Exact text match
A direct comparison identifies whether a cell holds a specific text value.
=IF(A1="Apple","Match","No Match")
This formula returns “Match” when A1 contains Apple as the only content.
2. Partial text match
A partial match identifies whether the text appears anywhere within the cell.
=IF(ISNUMBER(SEARCH("Apple",A1)),"Found","Not Found")
SEARCH locates the index of the text.
ISNUMBER confirms the returned index is a number.
3. Check if a cell contains any text
The formula below checks for text of any kind.
=IF(ISTEXT(A1),"Text","Not Text")
This method identifies alphabetic characters, words, or mixed strings.
4. Check if a cell is not blank and contains text
The condition treats empty cells differently from text cells.
=IF(AND(A1<>"",ISTEXT(A1)),"Text Present","No Text")
The combination ensures Excel detects only meaningful text entries.
How to run IF with text on Windows vs. Mac
The formulas are identical.
Shortcut differences appear only when inserting functions:
Windows
-
Press Shift + F3 to open Insert Function.
-
Select IF.
-
Enter logical test, true result, and false result.
Mac
-
Press fn + Shift + F3 to open Insert Function.
-
Select IF.
-
Enter logical test, true result, and false result.
Best practices for IF with text
-
Use
SEARCHfor case-insensitive checks. -
Use
FINDfor case-sensitive checks. -
Wrap the function in
ISNUMBERwhen searching text. -
Use quotation marks around text in formulas.
-
Avoid extra spaces to prevent mismatches.
When to use wildcards with IF
Wildcards work only with functions that support pattern matching, such as COUNTIF, SUMIF, or IFS.
Example pattern match inside IF:
=IF(COUNTIF(A1,"*Apple*")>0,"Found","Not Found")
The asterisks allow the formula to detect the word even when it appears inside longer strings.
. Was this Helpful?Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
Why is today function not working
Answers · 1
How to extract date from datetime in excel
Answers · 1
Why is the date value not working
Answers · 1
How to create a date formula
Answers · 1