+ Reply to Thread
Results 1 to 7 of 7

Return different matches that contains part of the searched text

  1. #1
    Registered User
    Join Date
    08-11-2023
    Location
    Tbilisi
    MS-Off Ver
    MS 365
    Posts
    16

    Return different matches that contains part of the searched text

    Hello,

    I have excel with column A and column C. Where A1=apple, A2=melon, A3=pear, A4=apple, A5=melon, A6=melon, A7=melon, A8=pear, A9=apple. C1=apple1, C2=apple2, C3=apple3, C4=apple4, C5=apple5, C6=pear1, C7=pear2, C8=pear3, C9=melon1, C10=melon2, C11=apple6, C12=apple7. I need a formula in B column, that returns the value from C column, that contains values from column A. Also I need it to return different results. For example, B1 must find apple (a1) that is containing in cell from C columns, that are "apple1", "apple2", "apple3", "apple4", "apple5", "apple6", "apple7", and must return "apple1", but B4 that has A4 "apple" also, must return "apple2", because "apple1" was already returned in B1.

    I have attached the file, where in B colum I wrote what should be the results of the formula.

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Return different matches that contains part of the searched text

    this...? =A1&COUNTIF($A$1:A1,A1)
    in B1 dragged down.
    however if the results in B6 and B7 (#N/A) are what you want then you should define why.
    Also that formula doesn't need what is in col C, is col C necessary to what you are trying to do?

    EDIT: and not sure but you may need to change the comma to a semicolon if your regional settings require that so it would look like this... =A1&COUNTIF($A$1:A1;A1)
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    08-11-2023
    Location
    Tbilisi
    MS-Off Ver
    MS 365
    Posts
    16

    Re: Return different matches that contains part of the searched text

    I mean instead of "1" inside "apple1" might be any text eg> "apple pie" or "apple plate". I need the formula to find "apple" inside "something apple something". And I need the formula not to return the same result it was matched above, eg if it returns "apple1" in B1 next to "apple (A1), it must not return the same "apple1" in B4, that is also next to "apple" (A4), but it must return "apple2" (that is from the list in C column), and B6 and B7 are #N/A because there are only 2 "melon" consisting in C column, "melon1" and "melon2" that are already matched in B2 and B5.

  4. #4
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Return different matches that contains part of the searched text

    Well, I'll try to think of something better, but now, maybe try this in cell B1:
    =XLOOKUP(TRUE,ISNUMBER(SEARCH(A1,$C$1:$C$12)),$C$1:$C$12,"",0)

    then in cell B2:
    =LET(a,$C$1:$C$12,b,FILTER(a,ISNA(MATCH(a,B$1:B1,0))),XLOOKUP(TRUE,ISNUMBER(SEARCH(A2,b)),b,"",0))
    and copy down.

  5. #5
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,434

    Re: Return different matches that contains part of the searched text

    Another solution:

    Please try in B1 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Return different matches that contains part of the searched text

    In B2 then copydown
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Return different matches that contains part of the searched text

    For 365 version in B2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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. Replies: 5
    Last Post: 04-06-2019, 02:18 AM
  2. [SOLVED] Any Faster Way to Copy/Paste this range? (I have searched and searched and searched)
    By liquidmettle in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-12-2015, 02:33 PM
  3. [SOLVED] Return value when part of a cell matches a word in a reference column
    By crazyb78 in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 07-29-2015, 05:28 AM
  4. VLOOKUP Partial matches when searched text is longer than actual text
    By mockions in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-23-2015, 11:16 PM
  5. Replies: 15
    Last Post: 10-15-2014, 03:30 AM
  6. Replies: 9
    Last Post: 07-03-2013, 07:39 AM
  7. Replies: 2
    Last Post: 07-14-2011, 09:04 AM

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