+ Reply to Thread
Results 1 to 5 of 5

Display all matches if cell contains text from list

  1. #1
    Registered User
    Join Date
    06-20-2020
    Location
    India
    MS-Off Ver
    10.02
    Posts
    6

    Lightbulb Display all matches if cell contains text from list

    I recorded a macro, which returns the matching value of column B for column A. The column A is a dynamic list, which i update everyday and column B is static (will always remain the same).

    For eg: If in column A, i have ABC, DEF, GHI and in column B I have ABC and DEF. It returns the first value listed in column B, which is "ABC". However, I want the formula to return all matching values for column A, which are ABC and DEF in this case.

    The formula I am using is

    =IFERROR(INDEX(abc_l, SMALL(IF(COUNTIF($E153, "*"&abc_l&"*"), MATCH(ROW(abc_l), ROW(abc_l)), ""), COLUMNS($A$1:A152))), "")

    where abc_l is a defined list.

    PS: I am an excel noob with little knowledge of VBA

    Thank you !
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Display all matches if cell contains text from list

    UDF

    Use in cell like
    =MatchMulti(A2:A6,B2:B5,",")

    To a stabdard code module
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-20-2020
    Location
    India
    MS-Off Ver
    10.02
    Posts
    6

    Re: Display all matches if cell contains text from list

    Thank you jindon. I am a complete VBA noob so wanted your help in understanding your formula. Could I edit the formula and just change "Match" In my formula to "MatchMulti". I tried doing that but it didn't work. I used the following formula:

    =IFERROR(INDEX(abc_l, SMALL(IF(COUNTIF($E153, "*"&abc_l&"*"), MatchMulti(ROW(abc_l), ROW(abc_l)), ""), COLUMNS($A$1:A152))), "")

    Thanks again!
    Last edited by Frankjager; 06-22-2020 at 02:35 PM.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Display all matches if cell contains text from list

    You need to upload a workbook with before/after clearly showing what you are trying to do.

  5. #5
    Registered User
    Join Date
    06-20-2020
    Location
    India
    MS-Off Ver
    10.02
    Posts
    6

    Re: Display all matches if cell contains text from list

    Thanks Jindon. I think i figured it out now. I am able to return all matching values. I used this formula

    =TEXTJOIN(", ", TRUE, IF(COUNTIF(E2, "*"&abc_l&"*"), abc_l, ""))

+ 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. if text cell matches list then put the next text cell, please help!
    By Marco2020 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-04-2020, 11:12 PM
  2. Replies: 3
    Last Post: 10-01-2019, 01:21 AM
  3. [SOLVED] If a range matches a cell, display text from another cell
    By DarrenCl in forum Excel General
    Replies: 3
    Last Post: 07-20-2017, 10:48 AM
  4. [SOLVED] Macro to jump to a cell that matches the text selected from a dropdown list.
    By agalvan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-24-2014, 06:28 PM
  5. Replies: 2
    Last Post: 08-05-2013, 07:32 PM
  6. [SOLVED] Formula to display cell if the text content partially matches a search term
    By Avestron in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-11-2013, 04:07 AM
  7. Replies: 7
    Last Post: 08-15-2006, 05:35 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