KutoolsforOffice — One Suite. Five Tools. Get More Done.

If Cell Contains Specific Text Then Return Value in Excel (3 Easy Methods)

AuthorSiluviaLast modified

When working with Excel, you may often need to check whether a cell contains specific text and return a corresponding value. For example, if a cell contains the word “multiple”, you may want to return “Yes”; otherwise, return a blank or another value.

if a cell contains text multiple then return Yes

However, Excel does not provide a direct built-in feature for this task. Instead, you need to rely on formulas, VBA, or third-party tools. In this article, we will introduce three practical methods to help you achieve this: using Excel formulas, VBA, and a much easier solution with Kutools for Excel.


Return Value If Cell Contains Specific Text Using Excel Formula

Excel formulas provide a flexible way to determine whether a cell contains specific text. Although there is no single function designed specifically for this task, you can combine functions like IF, SEARCH, and ISNUMBER to achieve it.

For example, in the worksheet below, if a cell in column A contains the text "multiple", we want to return "Yes" in column B.

the sample date

Steps:

  1. Select a blank cell where you want to display the result (e.g., B3).
  2. Enter the following formula and press Enter to get the first result.
    =IF(ISNUMBER(SEARCH("multiple",A2)),"Yes","")
  3. Drag the fill handle down to apply the formula to other cells.
    the formula result

Formula Explanation:

  • SEARCH("multiple", A3) → checks if the text "multiple" exists in the cell A3.
  • ISNUMBER(...) → returns TRUE if found.
  • IF(...) → returns "Yes" if TRUE, otherwise blank.
Notes:
  • This method supports partial matching (contains text).
  • It is case-insensitive (SEARCH ignores case).
  • The formula can become complex when conditions increase.

Return Value If Cell Contains Specific Text Instantly with Kutools for Excel

If you are looking for a faster and more user-friendly solution, Kutools for Excel provides a built-in formula tool that allows you to achieve this task without writing any formulas.

With Kutools Formula Helper, you can complete the entire process through a visual interface, making it ideal for beginners and users who want to save time.

Kutools for Excel - Packed with over 300 essential tools for Excel. Make Excel tasks faster, easier, and more efficient. Download now!

Steps:

  1. Select a cell to return the result.
  2. Click Kutools > Formula Helper > Text > Cell contains specific text then return value.
    enable kutools
  3. In the Formula Helper dialog box, configure the arguments:
    • Cell: Select the cell where you want to check the text.
    • Search value: Enter the text you want to search (e.g., "multiple").
    • Return value: Enter the value to return (e.g., "Yes").
  4. Click OK.
    configure the formula helper

Result:

The result is returned instantly for the selected cell, with the formula generated automatically—no formulas to remember. You can then drag the fill handle down to apply it to the remaining cells.

kutools results

Kutools for Excel - Supercharge Excel with over 300 essential tools, making your work faster and easier, and take advantage of AI features for smarter data processing and productivity. Get It Now

Why Use Kutools for This Task

  • No need to remember formulas.
  • No syntax errors.
  • Visual and intuitive interface.
  • Perfect for beginners and non-technical users.

Return Value If Cell Contains Specific Text Using User-defined Function

If you need a more customizable or automated solution, VBA can also be used to perform this task. However, this method requires basic programming knowledge and is less suitable for most users.

Steps to Use VBA:

  1. Press Alt + F11 to open the VBA editor.
  2. Click Insert > Module.
  3. Paste the code into the module window.
    VBA Code: Return value if cell contains specific text
    Function ContainsText(rng As Range, txt As String) As String
        If InStr(1, rng.Value, txt, vbTextCompare) > 0 Then
            ContainsText = "Yes"
        Else
            ContainsText = ""
        End If
    End Function
    enter the VBA code
  4. Press Alt + Q to return to Excel. Then enter the following formula into the cell where you want to return result:
    =ContainsText(A2,"multiple")
  5. Press Enter and drag down to apply.
    use the user-defined function
Note: To retain the VBA code for future use, you need to save the workbook as an Excel Macro-Enabled Workbook (.xlsm).

Limitations:

  • Requires VBA knowledge.
  • Macros must be enabled.
  • Not suitable for most users.

Conclusion

Returning a value if a cell contains specific text is a common task in Excel, and there are several ways to achieve it.

  • The Excel formula method is flexible and widely used, but requires understanding nested functions.
  • The VBA method offers more control, but is not suitable for most users.
  • Kutools for Excel provides the easiest solution, allowing you to complete the task without writing any formulas.

If you want a quick, reliable, and error-free way to handle this task, using Kutools Formula Helper is the most efficient choice.


Best Office Productivity Tools

🤖Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |  Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |  Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

ExcelWordOutlookTabsPowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in

Kutools for Excel

Brings 300+ powerful features to streamline your Excel tasks.