+ Reply to Thread
Results 1 to 16 of 16

Match substrings within cells

  1. #1
    Registered User
    Join Date
    01-01-2021
    Location
    Morocco
    MS-Off Ver
    2018
    Posts
    31

    Match substrings within cells

    Can anyone help me with an excel formula to look whether one cell with a string of text is the same compare to other cell with the same string of text but in different position/placement.

    please see below for example:

    cell A1: apple orange grape

    cell A2: orange grape apple

    I need a formula to check if A1 is the same or not to A2

    thanks

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,612

    re: Match substrings within cells

    Hi
    you posted in an Access subforum. Is this correct?

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,880

    re: Match substrings within cells

    Let's just assume that was a newbie error; moved to a more appropriate subforum.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    re: Match substrings within cells

    One way:

    =IF(SUMPRODUCT(--ISNUMBER(SEARCH(TRIM(MID(SUBSTITUTE(" "&$C$2," ",REPT(" ",100)),100*{1,2,3},100)),E2)))=3,"Match","")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Match substrings within cells

    Hi, Youssef.

    Forum Rule 1 is very short. It states: "Title must briefly summarize your request."

    A GOOD thread title is the sort of thing you would use as a search term on Google*. Your chosen title would produce a squillion useless hits. In future, please take a bit more time to think of a descriptive title that would be "Google-friendly". Many people search the forum answers looking for help and your very general title wouldn't help them at all.

    Since you are a new user of this site. On this occasion, I have changed it for you.

    However, if you continue to use weak titles, you can expect to have your thread BLOCKED until you change it yourself. If that happens, to edit the thread title, open the original post, click "Edit Post" (bottom right) to access the area where you can edit your title.

    *Other search engines are available!!!

    Regards,

    Glenn.

  6. #6
    Registered User
    Join Date
    01-01-2021
    Location
    Morocco
    MS-Off Ver
    2018
    Posts
    31
    Thank you for your feedback, I'm just worth knowing the number 100 indicated on the equation and how we can solve the problem indicated in red in attachment on the image remains of Match if we add a letter on one of the words
    Attached Images Attached Images

  7. #7
    Registered User
    Join Date
    01-01-2021
    Location
    Morocco
    MS-Off Ver
    2018
    Posts
    31

    Re: Match substrings within cells

    well noted dear Glenn i am sorry as you have i am a beginner on this network

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Match substrings within cells

    It can be done, but the formula will be much longer. I'll look at it tomorrow.

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,767

    Re: Match substrings within cells

    Borrowing Glenn's formula, try
    =IF(SUMPRODUCT(--ISNUMBER(SEARCH(" "&TRIM(MID(SUBSTITUTE(" "&$C$2," ",REPT(" ",100)),100*{1,2,3},100))&" "," "&E2&" ")))=3,"Match","")

  10. #10
    Registered User
    Join Date
    01-01-2021
    Location
    Morocco
    MS-Off Ver
    2018
    Posts
    31
    Hello Dean
    Here is the problem in attachment

  11. #11
    Registered User
    Join Date
    01-01-2021
    Location
    Morocco
    MS-Off Ver
    2018
    Posts
    31
    1609537579846_image.png
    Attached Images Attached Images

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,658

    Re: Match substrings within cells

    Change all the commas , to semi-colons ; .

    Who is Dean?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  13. #13
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,767

    Re: Match substrings within cells

    You may need to replace the commas with semi-colons.

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Match substrings within cells

    Fluff's amendment to my formula works fine. However, you'll need to use the semicolons in Morocco.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    01-01-2021
    Location
    Morocco
    MS-Off Ver
    2018
    Posts
    31
    Quote Originally Posted by Glenn Kennedy View Post
    Fluff's amendment to my formula works fine. However, you'll need to use the semicolons in Morocco.
    Thanks it works

  16. #16
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Match substrings within cells

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It would also be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

+ 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. Match Cell Substrings to Column and Return Adjacent Cell
    By ashb444 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-06-2015, 11:24 AM
  2. [SOLVED] Match multiple substrings in a cell against a lookup table and return concatenated values
    By stevewc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2013, 10:50 AM
  3. Determine cells common substrings
    By zhshqzyc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-18-2011, 12:39 PM
  4. Substrings from String
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-23-2010, 05:08 PM
  5. [SOLVED] Macro Help for Substrings
    By douglascfast@hotmail.com in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2006, 11:10 AM
  6. sum wrt substrings!
    By via135 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-26-2006, 02:06 PM
  7. Replacing Substrings with Numbers from Adjacent Cells
    By ExcelTip in forum Tips and Tutorials
    Replies: 0
    Last Post: 08-23-2005, 04: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