Table of Contents
The IF function in Excel allows users to perform logical tests and return specific values based on the results. This function can also be used with text values, providing a powerful tool for manipulating and analyzing data. To use the IF function with text values in Excel, simply follow these steps:
1. Start by typing the IF function in the cell where you want the result to appear.
2. Next, open parentheses and enter the logical test in the first argument. For example, you can use the logical test “A1=”Apples” to check if the value in cell A1 is equal to “Apples”.
3. In the second argument, enter the value to be returned if the logical test is true. This can be a text value enclosed in quotation marks, such as “Yes”.
4. In the third argument, enter the value to be returned if the logical test is false. Again, this can be a text value enclosed in quotation marks, such as “No”.
5. Close the parentheses and press Enter to see the result.
By using the IF function with text values, you can easily categorize and filter data based on specific criteria. It is a useful tool for organizing and analyzing large sets of data in Excel.
Excel: Use IF Function with Text Values
You can use the following formulas to use an IF function with text values in Excel:
Method 1: Check if Cell is Equal to Text
=IF(A2="Starting Center", "Yes", "No")
This formula will return “Yes” if the value in cell A2 is “Starting Center” – otherwise it will return “No.”
Method 2: Check if Cell Contains Specific Text
=IF(ISNUMBER(SEARCH("Guard", A2)), "Yes", "No")
This formula will return “Yes” if the value in cell A2 contains “Guard” anywhere in the cell – otherwise it will return “No.”
Method 3: Check if Cell Contains One of Several Specific Texts
=IF(SUMPRODUCT(--ISNUMBER(SEARCH({"Backup","Guard"},A2)))>0, "Yes", "No")
This formula will return “Yes” if the value in cell A2 contains “Backup” or “Guard” anywhere in the cell – otherwise it will return “No.”
The following examples show how to use each formula in practice with the following dataset in Excel:

Example 1: Check if Cell is Equal to Text
We can type the following formula into cell C2 to return “Yes” if the value in cell A2 is equal to “Starting Center” or return “No” otherwise:
=IF(A2="Starting Center", "Yes", "No")We can then click and drag this formula down to each remaining cell in column C:

Example 2: Check if Cell Contains Specific Text
We can type the following formula into cell C2 to return “Yes” if the value in cell A2 contains “Guard” anywhere in the cell or return “No” otherwise:
=IF(ISNUMBER(SEARCH("Guard", A2)), "Yes", "No")We can then click and drag this formula down to each remaining cell in column C:

The formula returns “Yes” for each row that contains “Guard” in column A and returns “No” for all other rows.
Example 3: Check if Cell Contains Several Specific Texts
We can type the following formula into cell C2 to return “Yes” if the value in cell A2 contains “Backup” or “Guard” anywhere in the cell or return “No” otherwise:
=IF(SUMPRODUCT(--ISNUMBER(SEARCH({"Backup","Guard"},A2)))>0, "Yes", "No")We can then click and drag this formula down to each remaining cell in column C:

The formula returns “Yes” for each row that contains “Backup” or “Guard” in column A and returns “No” for all other rows.
Note: Feel free to include as many text values as you’d like in the curly brackets in the formula to search for as many specific text values in a cell as you’d like.
The following tutorials explain how to perform other common tasks in Excel:
Cite this article
stats writer (2024). How do I use the IF function with text values in Excel?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-do-i-use-the-if-function-with-text-values-in-excel/
stats writer. "How do I use the IF function with text values in Excel?." PSYCHOLOGICAL SCALES, 25 Jun. 2024, https://scales.arabpsychology.com/stats/how-do-i-use-the-if-function-with-text-values-in-excel/.
stats writer. "How do I use the IF function with text values in Excel?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-do-i-use-the-if-function-with-text-values-in-excel/.
stats writer (2024) 'How do I use the IF function with text values in Excel?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-do-i-use-the-if-function-with-text-values-in-excel/.
[1] stats writer, "How do I use the IF function with text values in Excel?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How do I use the IF function with text values in Excel?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
