+ Reply to Thread
Results 1 to 7 of 7

Find matching text and matching unique ID

  1. #1
    Registered User
    Join Date
    04-11-2017
    Location
    Scotland
    MS-Off Ver
    2010
    Posts
    5

    Find matching text and matching unique ID

    Hi guys,

    I've been looking for a solution to a manual task I have to carry out with no avail - I'm not sure whether it can be completed using excel tools or if it will need some VBA code so I thought I would reach out to some experts...

    Basically I have 2 separate lists that should have a few matching pieces of text, both of which have a unique ID to their respective list. I'm trying to match the text so that I can easily find the two unique numbers, how would I do this? I'll put together a short example below...

    ID1 Text1 Matching ID2 ID2 Text2
    1 Aberdeen 3 1 Liverpool
    2 Glasgow 2 Dundee
    3 Manchester 3 Aberdeen
    4 London 4 Coventry

    What I would like to do is look for each entry under Text1 in the Text 2 column and, if they match, copy the ID2 into the Matching ID2 column. So in the example above I would look for "Aberdeen" in Text2 and see it matches under ID2, so I would populate Matching ID2 with a "3". I would then look for "Glasgow" in Text2, then "Manchester" and so on.

    This is a simplified version of the data involved, so I'd imagine the solution will look for text within a cell references as opposed to looking for specific text. I had a look into VLOOKUP and INDEX functions but I couldn't figure out if they would work in this situation.

    Any help would be appreciated, thanks.

    EDIT: I've noticed the formatting changes once I submit the thread, I'll attach a screen grab of the workbook.Capture.JPG
    Last edited by AndrewRobinson; 06-01-2017 at 05:31 AM.

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Find matching text and matching unique ID

    Hi
    assuming your headings are in cells A1:E1 and your data in cells A2:E5 try this formula

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-11-2017
    Location
    Scotland
    MS-Off Ver
    2010
    Posts
    5

    Re: Find matching text and matching unique ID

    Quote Originally Posted by NickyC View Post
    Hi
    assuming your headings are in cells A1:E1 and your data in cells A2:E5 try this formula

    Please Login or Register  to view this content.
    Hi Nicky,

    Many thanks for the quick reply. The code appears to work in my simplified workbook but in the actual workbook I only get "#N/A" and a few "#VALUE!" results, unfortunately no ID's are copied across. I modified the code slightly to the following:

    Please Login or Register  to view this content.
    The reasons being: Cell E2 is ID2, C2 is Text1 and the range is fairly substantial. I'm assuming my error is due to the complexity of the text under Text1/Text2, maybe there are minor differences...I shall investigate further. Is there perhaps a way to use approximate matches such as in the VLOOKUP function?

    EDIT: I've noticed that in Text2 the text is introduced by a number, so going back to the example it would read "1.Aberdeen" (no spaces between . and A), is there a way around this?

    Thanks again for your help.
    Last edited by AndrewRobinson; 06-01-2017 at 06:07 AM.

  4. #4
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Find matching text and matching unique ID

    Hi
    there is almost certainly a way to do this. If you upload a copy of your data (or an approximation, if it is confidential) that will help.
    I'm signing off for the night now (the downside of forum contributors in every time zone) but I will look at your problem again tomorrow if it hasn't been solved in the meantime

  5. #5
    Registered User
    Join Date
    04-11-2017
    Location
    Scotland
    MS-Off Ver
    2010
    Posts
    5

    Re: Find matching text and matching unique ID

    Infact upon further review it appears that there are a few minor differences, such as ";" being used instead of ":" in some, and different styles of bullet points being used...So I guess that only leaves an approximate match, if such a function can be used in this sense.

    Apologies for not realising this sooner, I have always just looked for key words and being a manual task the details have escaped me.

  6. #6
    Registered User
    Join Date
    04-11-2017
    Location
    Scotland
    MS-Off Ver
    2010
    Posts
    5

    Re: Find matching text and matching unique ID

    Quote Originally Posted by NickyC View Post
    Hi
    there is almost certainly a way to do this. If you upload a copy of your data (or an approximation, if it is confidential) that will help.
    I'm signing off for the night now (the downside of forum contributors in every time zone) but I will look at your problem again tomorrow if it hasn't been solved in the meantime
    Many thanks, Nicky. Unfortunately the data is sensitive but I will try to replicate my problem and upload an example spreadsheet later today (I can't upload workbooks to third party sites at work).

    Thanks again.

  7. #7
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Find matching text and matching unique ID

    Hi
    you might find this thread helpful

    https://www.excelforum.com/excel-gen...mes-sheet.html

+ 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] Matching multiple cells on 2 separate rows, but returning a unique text value
    By IreSaffa in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-16-2016, 05:31 AM
  2. [SOLVED] Alter Matching Sub From matching two Ranges to matching one range and list
    By capson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2015, 10:48 PM
  3. Weirdest problem ever - excel not matching matching text
    By andre_as in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-19-2015, 03:33 AM
  4. Replies: 6
    Last Post: 11-26-2014, 11:45 AM
  5. Replies: 5
    Last Post: 12-21-2013, 03:03 PM
  6. Replies: 2
    Last Post: 04-11-2013, 11:14 AM
  7. [SOLVED] How to find all unique, matching values betwen two arrays of cells
    By exmonkey in forum Excel General
    Replies: 11
    Last Post: 06-20-2012, 05:47 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