How to Return TRUE If Cell Contains Text in Excel (8 Easy Ways)

Sometimes we need to determine whether a cell contains text or not. Because that cell might be needed for other purposes where the cell format needs to be text. Here, we will discuss how you can return True if the cell contains text in Excel using 8 easy methods with detailed explanations.

Here, we directly returned TRUE in cell C5 based on whether there is a text in cell B5 using the ISTEXT function.

overview of Excel Return True If Cell Contains Text


Download Practice Workbook

You can download the free practice Excel template from here and practice on your own.


8 Easy Ways to Return TRUE If Cell Contains Text in Excel

Here in the below dataset, we have the product category of the vegetable cart. It also has some outliers also as numbers. For this dataset, we will determine which of them are text and return TRUE if they are text indeed. For avoiding any compatibility issues, try to use the Excel 365 edition.

sample dataset containing the Category of the products


1. Use ISTEXT Function to Directly Return TRUE If Cell Contains Text

Here, the ISTEXT function will directly determine whether the cell has text or not. And later will return TRUE or FALSE based on it. Therefore, follow the below steps to return true if the cell contains the text.

Steps:

  • Select cell C5 and enter the following formula:

=ISTEXT(B5)

  • Press Enter after this.

Use ISTEXT Function to Return True If C5 Cell Contains Text

  • Then drag the Fill Handle to cell C13.
  • After that, you will notice that the range of cell C5:C13 returned TRUE or FALSE based on whether there is text in each cell in the range of cell B5:B13.

using autofill returns other results

Read More: If Cell Contains Text Then Add Text in Another Cell in Excel


2. Return TRUE for Text Through IF Function with Match Word

Here, the IF function will be used to determine whether a cell has text values or not. And return TRUE or FALSE based on it.

Steps:

  • Select cell C5 and enter the following formula:

=IF(B4="Bars","True","False")

  • Press Enter after this.

IF Function returns true for specific text

  • Then drag the Fill Handle to cell C13.
  • After that, you will notice that the range of cell C5:C13 returned TRUE or FALSE based on whether there is text in each cell in the range of cell B5:B13.

autofill returns IF function outputs for the below cells

Read More: How to Assign Value If Cell Contains Word in Excel (4 Easy Ways)


3. Utilize ISNUMBER and SEARCH Functions to Return TRUE for Specific Text

The combination of the ISNUMBER and the SEARCH function will be used to determine whether a cell has text values or not and return TRUE and FALSE based upon it.

Steps:

  • Select cell C5 and enter the following formula:

=ISNUMBER(SEARCH(B5,"Bars"))

  • Press Enter after this.

Utilize ISNUMBER and SEARCH Functions to return true if C5 cell contains specific text

🔍 Formula Breakdown

➢ SEARCH(B5,”Bars”): This part of the function will determine whether the text Bars is in cell B5 and return its position of it.

➢ =ISNUMBER(SEARCH(B5,”Bars”)): This part of the function will determine whether the return from the previous function is numerical or not. If it jis numerical, then it will return  TRUE, otherwise FALSE.

  • Then drag the Fill Handle to cell C13.
  • After that, you will notice that the range of cell C5:C13 returned TRUE or FALSE based on whether there is text in each cell in the range of cell B5:B13.

TRUE and FALSE is returned after using fill handle

Read More: If Cell Contains Specific Text Then Add 1 in Excel (5 Examples)


4. Apply ISNUMBER and FIND Functions to Return True by Finding Text

The combination of the ISNUMBER and the FIND function will be used to determine whether a cell has text values or not and return TRUE and FALSE based on it.

Steps:

  • Select cell C5 and enter the following formula:

=ISNUMBER(FIND(B5,"Bars"))

  • Press Enter after this.

Apply ISNUMBER and FIND Functions to return true if cell contains particular text in Excel

🔍 Formula Breakdown

➢ FIND(B5,”Bars”): This part of the function will determine whether the text Bars is in cell B5 and return its position of it.

➢ ISNUMBER(FIND(B5,”Bars”)): This part of the function will determine whether the return from the previous function is numerical or not. If it jis numerical, then it will return  TRUE, otherwise FALSE.

  • Then drag the Fill Handle to cell C13.
  • After that, you will notice that the range of cell C5:C13 returned TRUE or FALSE based on whether there is text in each cell in the range of cell B5:B13.

TRUE and FALSE is returned after using autofill for ISNUMBER and FIND functions


5. Join IF, ISERRROR, and FIND Functions to Get TRUE for Text

Here we joined functions like IF, IFERROR, and FIND to determine whether a cell has text value or not and then return TRUE or FALSE based upon it. So, learn the following process to return true if the cell contains text in Excel.

Steps:

  • Select cell C5 and enter the following formula:

=IF(ISERROR(FIND("Bars",B5,1)),"False","TRUE")

  • Press Enter after this.

Join IF, ISERRROR, and FIND Functions to Get True for Text if C5 cell contains text in Excel

🔍 Formula Breakdown

➢ FIND(“Bars”,B5,1): This part of the function will determine whether the text Bars is in cell B5 and return its position of it.  1 represent as the starting position.

➢ ISERROR(FIND(“Bars”,B5,1)): This will determine whether the outcome from the previous function has error or not

➢ IF(ISERROR(FIND(“Bars”,B5,1)),”False”,”TRUE”): This part of the function will determine whether the return from the previous function has any error or not. If it is error, then it will return  FALSE, otherwise, will return TRUE.

  • Then drag the Fill Handle to cell C13.
  • After that, you will notice that the range of cell C5:C13 returned TRUE or FALSE based on whether there is text in each cell in the range of cell B5:B13.

autofil returns TRUE and FALSE for IF, ISERROR, and FIND functions

Read More: Sum If a Cell Contains Text in Excel (6 Suitable Formulas)


Similar Readings


6. Combine IF and COUNTIF Functions to Return True by Condition

Here we joined functions like IF and COUNTIF to determine whether a cell has text value or not and then return TRUE or FALSE based upon it.

Steps:

  • Select cell C5 and enter the following formula:

=IF(COUNTIF(B5,"*"&"Bars"&"*"),"True","False")

  • Press Enter after this.

Combine IF and COUNTIF Functions in Excel to return true if C5 cell contains specific text

🔍 Formula Breakdown

➢ COUNTIF(B5,”*”&”Bars”&”*”):  This part of this function will count the character that the cell B5 is equal to Bars.

➢ IF(COUNTIF(B5,”*”&”Bars”&”*”),”True”,”False”) This part of the function will determine whether the return from the previous function has any number or not. If it is a number, then it will return TRUE FALSE, otherwise, will return FALSE.

  • Then drag the Fill Handle to cell C13.
  • After that, you will notice that the range of cell C5:C13 returned TRUE or FALSE based on whether there is text in each cell in the range of cell B5:B13.

TRUE and false is returned for IF and COUNTIF functions after using autofill

Read More: Check If Cell Contains Text Then Return Value with Multiple Conditions in Excel


7. Apply IF and EXACT Functions by Matching Word Precisely

Here we joined functions like IF and EXACT to determine whether a cell has text value or not and then return TRUE or FALSE based upon it.

Steps:

  • Select cell C5 and enter the following formula:

=IF(EXACT(B5,"Bars"), "True", "False")

  • Press Enter after this.

Apply IF and EXACT Functions to return true if cell contains particular text in Excel

🔍 Formula Breakdown

➢ EXACT(B5,”Bars”):  This part of this function will determine the cell value in cell B5 with Bars or not. If they are the same, then it will return TRUE, otherwise FALSE.

➢ IF(EXACT(B5,”Bars”), “True”, “False”): This part will return TRUE if the return from the previous function is TRUE, otherwise it will return FALSE.

  • Then drag the Fill Handle to cell C13.
  • After that, you will notice that the range of cell C5:C13 returned TRUE or FALSE based on whether there is text in each cell in the range of cell B5:B13.

TRUE and false is returned for IF and EXACT functions after using autofill

Read More: How to Check If Cell Contains Text Then Return Value in Excel


8. Embedding VBA to Return TRUE If Cell Contains Exact Text

Using a simple VBA code will be made the task of determining whether a cell contains text or not hassle-free and faster. Hence, follow the below process to return true if the cell contains the text in Excel.

Steps:

  • We have the text value in cell B5, we need to determine whether this cell actually contains text or not and then return Yes or No based on the inspection.

dataset for applying vba method

  • First, go to the Developer tab and click on Visual Basic. If you don’t have that, you have to enable the Developer tab. Or You can also press ‘Alt+F11’for open the Visual Basic Editor.

select visual basic from developer tab

  • Then there will be a new dialog box. In that dialog box, click on Insert > Module.
  • Next, in the Module editor window, type the following code:
Sub Contains_text()
    If InStr(Range("B5").Value, "Bars") > 0 Then
    Range("C5").Value = "True"
    End If
End Sub

type code in module box

  • Then close the Module window.
  • After that, go to the View tab > Macros.
  • Then click on View Macros.

run the macro using view macros command

  • After clicking View Macros, select the macros that you created just now. The file name here is Contains_text.
  • Then click Run.

select macro in the Macro dialog box and run it

  • After clicking Run, you will notice that cell C5 is now showing TRUE, as cell B5 has text.

output of macro code returns true

Read More: How to Return Value in Excel If Cell Contains Text from List


Conclusion

To sum it up, the issue of how we can use format painter multiple times in Excel is shown here in 5 separate methods. For this problem, a macro-enabled workbook is available to download where you can practice these methods. Feel free to ask any questions or feedback through the comment section. Any suggestion for the betterment of the ExcelDemy community will be highly appreciable.


Related Articles

Rubayed Razib Suprov

Rubayed Razib Suprov

Hi, I am Rubayed Razib Suprov. Graduated from the Bangladesh University of Engineering Technology in Naval Architecture and Marine Engineering department. I joined Exceldemy on March 2022. I have a keen interest in both fluid dynamics and data analysis. I try to teach people what I learned so far about the Excel tool to date, and hope I can make some positive impacts.

We will be happy to hear your thoughts

Leave a reply

5 Excel Hacks You Never Knew

Genius tips to help you unlock Excel's hidden features

FREE EMAIL BONUS

ExcelDemy
Logo