Check IF a Cell Contains a Partial Text (Formula in Excel) (2024)

Home / Excel Formulas List / Check IF a Cell Contains a Partial Text (Formula in Excel)

Contents hide

Excel Formula: IF a Cell Contains a Partial Text

Get the Excel File

Related Formulas

To check if a cell contains a partial text in Excel, you need to create a formula, with the help of IF, COUNTIF, and wildcard characters. Wildcard characters help you define the partial text, then COUNTIF checks for partial value, and IF returns the result according to that. This combination of functions works perfectly.

Check IF a Cell Contains a Partial Text (Formula in Excel) (1)

In this tutorial, we will learn to write this formula.

Excel Formula: IF a Cell Contains a Partial Text

  1. First, in cell B1 enter “=IF(“.
  2. After that, enter “COUNTIF(“.
  3. Next, in the first argument of COUNTIF, refer to cell A1.
  4. Now, enter the value that you want to check by using an asterisk before and after that value and close the function.
  5. In the end, enter “Y” for value_if_true, “N” for value_if_false” enter closing parentheses, and hit enter.
Check IF a Cell Contains a Partial Text (Formula in Excel) (2)

=IF(COUNTIF(A1,”*Excel*”),”Y”,”N”)

In the following example, you can see in the first value you have “Excel”, and it has returned “Y”. But in the second value, you don’t have that value, and he has returned “N” in the result.

Check IF a Cell Contains a Partial Text (Formula in Excel) (3)

To understand this formula, you need to break it up into two parts:

Check IF a Cell Contains a Partial Text (Formula in Excel) (4)
  • In the first part, we have COUNTIF uses wildcard characters that check for the partial value from the cell. And if the value is there, it returns 1 in the result, and if not, it returns 2.
  • In the second part, IF takes the result of COUNTIF and uses 1 as TRUE and 0 as FALSE. So, if it’s TRUE it returns Y, and if it’s FALSE then N.

IF a Cell Contains a Partial Text (SEARCH + ISNUMBER)

You can also use a formula combining SEARCH, ISNUMBER, and IF to check if a partial value is there in a cell.

Check IF a Cell Contains a Partial Text (Formula in Excel) (5)

=IF(ISNUMBER(SEARCH(“Excel*”, A1)),”Y”,”N”)

This formula uses SEARCH and Wildcards to check for the value. If the value is there, it returns a number and if the value is not there, it returns an #VALUE! error.

To manage this error, you need to use ISNUMBER and IF. ISNUMBER checks if the result from SEARCH is a number or not and returns TRUE or FALSE.

Now, if the result from ISNUMBER is TRUE, IF returns “Y” and if it’s FALSE then IF returns “N”.

Get the Excel File

Check IF a Cell Contains a Partial Text (Formula in Excel) (2024)
Top Articles
Latest Posts
Article information

Author: Saturnina Altenwerth DVM

Last Updated:

Views: 5423

Rating: 4.3 / 5 (64 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Saturnina Altenwerth DVM

Birthday: 1992-08-21

Address: Apt. 237 662 Haag Mills, East Verenaport, MO 57071-5493

Phone: +331850833384

Job: District Real-Estate Architect

Hobby: Skateboarding, Taxidermy, Air sports, Painting, Knife making, Letterboxing, Inline skating

Introduction: My name is Saturnina Altenwerth DVM, I am a witty, perfect, combative, beautiful, determined, fancy, determined person who loves writing and wants to share my knowledge and understanding with you.