+ Reply to Thread
Results 1 to 6 of 6

Excel Formula to search multiple text from a list in a cell and return the searched text

  1. #1
    Registered User
    Join Date
    02-05-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    11

    Excel Formula to search multiple text from a list in a cell and return the searched text

    I am trying to build an excel formula which would search multiple text values from a list in a cell and return the same values separated by comma .i.e. concatenate values separated by comma. Right now the formula searches for only one text from the list even when the list consists of 2 or 3 matching text from the list. I want the formula to find all the matching text from the list (max matching value in a cell wouldn't be more then 5) and then concatenate those matching texts found separated by commas and if no match is found it should return no match found. Below is the screenshot and attached is the excel worksheet.

    Please Login or Register  to view this content.
    Attachment 618809
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by abhay_547; 04-05-2019 at 12:28 AM.

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Excel Formula to search multiple text from a list in a cell and return the searched te

    Two key questions:

    1. how many search terms in your real-life dataset (D2:D8 in above) ?

    2a. are you, definitely, running XL2013? we ask because if using either 2016 or O365 things become a lot simpler, in terms of native functions
    2b. do you have backwards compatibility issues -- I ask because you're using ISERROR (and double evaluation) rather than IFERROR - latter not available until XL2007.

  3. #3
    Registered User
    Join Date
    02-05-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    11
    Quote Originally Posted by XLent View Post
    Two key questions:

    1. how many search terms in your real-life dataset (D2:D8 in above) ?

    2a. are you, definitely, running XL2013? we ask because if using either 2016 or O365 things become a lot simpler, in terms of native functions
    2b. do you have backwards compatibility issues -- I ask because you're using ISERROR (and double evaluation) rather than IFERROR - latter not available until XL2007.
    1. Around 50 to 60 terms in column D
    2a. Office 2010 in office and office 2013 at home solution required for office
    2b. No backward compatibility issue

  4. #4
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Excel Formula to search multiple text from a list in a cell and return the searched te

    OK; so one formula based option - based on above - would be as follows:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    You could achieve the same with a succinct UDF but it all comes down to whether or not using code is problematic for you.

  5. #5
    Registered User
    Join Date
    02-05-2018
    Location
    India
    MS-Off Ver
    2013
    Posts
    11

    Re: Excel Formula to search multiple text from a list in a cell and return the searched te

    Great.Its working as expected. thanks.

    Also, do you have example of succinct UDF

  6. #6
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Excel Formula to search multiple text from a list in a cell and return the searched te

    I'm not on my usual machine so don't have any existing code to hand but something like the below should work, and offer flexibility -- obviously it would account for 1 to n matches (unlike the formula)...

    Place in standard module,and then called via worksheet as:

    =CONCAT_CRIT($A2,$D$2:$D$8)

    Can also be used to find all search terms across all cells, in single cell, e.g.

    =CONCAT_CRIT($A$2:$A$9,$B$2:$B$8)

    And has optional variables should you want to modify delimiter, alternative return (for 0 finds) and/or handle duplicity of terms if doing multiple searches where duplicate terms a possibility, e.g.

    =CONCAT_CRIT($A$2:$A$9,$B$2:$B$8,"^&",,FALSE)

    would give a very different answer to previous despite ranges being same...

    default behaviour: Options,Equity,Fund,Revenue,Legal,Compliance
    modified behaviour: Options^&Equity^&Fund^&Revenue^&Legal^&Legal^&Compliance^&Equity^&Fund

    Please Login or Register  to view this content.

+ 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. [SOLVED] Search for multiple words in row and return searched value if found in first cell
    By whomewhy in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 08-02-2018, 05:21 PM
  2. Search for multiple texts in cell, return specific text
    By mariur89 in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 11-24-2014, 06:43 PM
  3. Replies: 15
    Last Post: 10-15-2014, 03:30 AM
  4. Replies: 2
    Last Post: 05-12-2014, 08:21 AM
  5. Search cell for multiple text , return comma separated text in separate cell if found
    By dangerdoug in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2013, 01:52 PM
  6. Replies: 3
    Last Post: 06-17-2013, 01:09 PM
  7. [SOLVED] Formula to search array for text and return value from an offset cell
    By tif4300 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-14-2012, 09:04 PM

Tags for this Thread

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