+ Reply to Thread
Results 1 to 8 of 8

Return Cell Value if Contains Specific Text

  1. #1
    Registered User
    Join Date
    09-29-2015
    Location
    Dallas, TX
    MS-Off Ver
    2010
    Posts
    6

    Return Cell Value if Contains Specific Text

    Hi all!

    I have a range of text (customer names), similar to below:

    ABC Company U.S.
    Wildcard Incorporated
    XYZ LLC
    Worldwide Corporation

    I'm looking to find company XYZ and Wildcard within this range. I have a countif formula to count how many times the company is mentioned within the list using the text "XYZ" and "Wildcard". Turns out each company I'm looking for is only listed once. How do I write a formula that returns the entire value of the cell in which I've found "XYZ" and "Wildcard". (It would return "XYZ LLC" and "Wildcard Incorporated".)

    Thanks!!

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Return Cell Value if Contains Specific Text

    A possibility...

    Data Range
    A
    B
    C
    D
    1
    ABC Company U.S.
    XYZ
    XYZ LLC
    2
    Wildcard Incorporated
    Wildcard
    Wildcard Incorporated
    3
    XYZ LLC
    4
    Worldwide Corporation
    ------


    This formula entered in D1 and copied down:

    =INDEX(A$1:A$4,MATCH(C1&"*",A$1:A$4,0))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    09-29-2015
    Location
    Dallas, TX
    MS-Off Ver
    2010
    Posts
    6

    Re: Return Cell Value if Contains Specific Text

    Thanks for the response!

    When I try that formula with my table, it's returning #N/A. Do you know why that could be?

  4. #4
    Registered User
    Join Date
    09-29-2015
    Location
    Dallas, TX
    MS-Off Ver
    2010
    Posts
    6

    Re: Return Cell Value if Contains Specific Text

    Oh got it!

    This is what I put (just added another "*" before the text being searched):

    =INDEX(A$1:A$4,MATCH("*"&C1&"*",A$1:A$4,0))

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Return Cell Value if Contains Specific Text

    Good deal. Thanks for the feedback!

    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

  6. #6
    Registered User
    Join Date
    07-24-2015
    Location
    Puget Sound, Washington State, USA
    MS-Off Ver
    MS Office 2016
    Posts
    15

    Re: Return Cell Value if Contains Specific Text

    I can't get it to work. Using Excel 2013. Is there a better way?

  7. #7
    Registered User
    Join Date
    07-24-2015
    Location
    Puget Sound, Washington State, USA
    MS-Off Ver
    MS Office 2016
    Posts
    15

    Re: Return Cell Value if Contains Specific Text

    Huh. Found out a network-sagging event corrupted my Excel. Now that it's been reinstalled, the formula works. Many thanks.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Return Cell Value if Contains Specific Text

    You're welcome. Thanks for the feedback!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Return specific value IF specific text in cell
    By scones in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-14-2015, 01:18 AM
  2. Look up several values in a cell and return a specific text
    By peterromer in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-27-2014, 12:03 PM
  3. [SOLVED] If cell contains specific text, return that text
    By kazphilips in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-12-2014, 09:41 AM
  4. [SOLVED] If a cell contains a specific text than return a value
    By dcdeez in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-04-2013, 08:31 AM
  5. [SOLVED] Help to return only first 12 characters when a cell contains specific text
    By ports83 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-25-2012, 10:30 PM
  6. Replies: 3
    Last Post: 06-20-2012, 07:16 AM
  7. Select cell containing specific text &return value from another ce
    By plf100 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-16-2005, 10:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1