• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Name Merger

isabelly1122

New Member
I need a formula to take two lists of words and if the end 2 or 3 letters or beginning 2 or 3 letters of one list match the end 2 or 3 letters or beginning 2 or 3 letters of the other list then to merge them and create a list with these merged words. I.e. list one: carrot, barge, office, tree and list two: rotten, equal, scoff, germinate then the list created will be: carrotten, scoffice, bargerminate
 

Attachments

  • Names Merger.xlsx
    9.1 KB · Views: 6
Quick but ugly:
Code:
=IF(OR(LEFT(C6,2)=LEFT(D6,2),LEFT(C6,2)=RIGHT(D6,2),RIGHT(C6,2)=RIGHT(D6,2),RIGHT(C6,2)=LEFT(D6,2),LEFT(C6,3)=LEFT(D6,3),LEFT(C6,3)=RIGHT(D6,3),RIGHT(C6,3)=RIGHT(D6,3),RIGHT(C6,3)=LEFT(D6,3)),C6&D6,"n/a")
 
I note that in your sample file you include a result Dell SpaceSpaceX, I'm guessing because the last 5 characters of Dell Space are the same as the first 5 characters of SpaceX, which doesn't tally with your:
if the end 2 or 3 letters or beginning 2 or 3 letters of one list match the end 2 or 3 letters or beginning 2 or 3 letters of the other list
If you want at least 2 characters to match but it can be any number then not so quick, and uglier:
Code:
=IF(OR(IFERROR(LEFT(C6,ROW(INDIRECT("A2:A" & LEN(C6))))=LEFT(D6,ROW(INDIRECT("A2:A" & LEN(D6)))),FALSE),IFERROR(LEFT(C6,ROW(INDIRECT("A2:A" & LEN(C6))))=RIGHT(D6,ROW(INDIRECT("A2:A" & LEN(D6)))),FALSE),IFERROR(RIGHT(C6,ROW(INDIRECT("A2:A" & LEN(C6))))=RIGHT(D6,ROW(INDIRECT("A2:A" & LEN(D6)))),FALSE),IFERROR(RIGHT(C6,ROW(INDIRECT("A2:A" & LEN(C6))))=LEFT(D6,ROW(INDIRECT("A2:A" & LEN(D6)))),FALSE)),C6&D6,"n/a")
You might need to commit this formula to the sheet with Ctrl + Shift + Enter rather than just Enter in your version of Excel which I think is Excel 2013. Try both ways.

If you've got a version of Excel which includes the Let() function then:
Code:
=LET(a,C6,b,D6,La,LEFT(a,ROW(INDIRECT("A2:A" & LEN(a)))),Lb,LEFT(b,ROW(INDIRECT("A2:A" & LEN(b)))),Ra,RIGHT(a,ROW(INDIRECT("A2:A" & LEN(a)))),Rb,RIGHT(b,ROW(INDIRECT("A2:A" & LEN(b)))),IF(OR(IFERROR(La=Lb,FALSE),IFERROR(La=Rb,FALSE),IFERROR(Ra=Rb,FALSE),IFERROR(Ra=Lb,FALSE)),a & b,"N/A"))
 
Last edited:
yes i am having some trouble understanding
ROW(INDIRECT("A2:A" & LEN " Will defintely search on youtube for this application as this is giving the perfect result
 
Back
Top