+ Reply to Thread
Results 1 to 6 of 6

Remove duplicates from column 1 and concatenate column 2 - is this possible?

  1. #1
    Registered User
    Join Date
    03-12-2014
    Location
    uk
    MS-Off Ver
    MAC 2011
    Posts
    5

    Post Remove duplicates from column 1 and concatenate column 2 - is this possible?

    Hello.
    My issue is that I have 1200+ addresses to make more readable - the first column is the street name, the second is the post code(s) relative to the street - what Ideally I'd like to achieve is one row per street, the street name followed by the post codes... i.e. take this...

    A33 Relief Road RG2 0RR
    Abbey Square RG1 3AG
    Abbey Square RG1 3BE
    Abbey Square RG1 3BQ
    Abbey Square RG1 3FB
    Abbey Street RG1 3AN
    Abbey Street RG1 3BA
    Abbey Street RG1 3BD
    Abbots Walk RG1 3HW
    Aberford Close RG30 2NX
    Admirals Court RG1 6SP
    Admirals Court RG1 6SR
    Admirals Court RG1 6SS
    Admirals Court RG1 6SW
    Ainsdale Crescent RG30 3NG
    Alan Place RG30 3BW
    Albany Road RG30 2UL

    to this...

    A33 Relief Road RG2 0RR
    Abbey Square RG1 3AG, RG1 3BE, RG1 3BQRG1 3FB
    Abbey Street RG1 3AN, RG1 3BA, RG1 3BD
    Abbots Walk RG1 3HW
    Aberford Close RG30 2NX
    Admirals Court RG1 6SP, RG1 6SR, RG1 6SS, RG1 6SW
    Ainsdale Crescent RG30 3NG
    Alan Place RG30 3BW
    Albany Road RG30 2UL

    Any and all help would be most gratefully received!
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    06-30-2011
    Location
    Toronto
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: Remove duplicates from column 1 and concatenate column 2 - is this possible?

    I have a user defined function (VBA-based function) that I found this week that should do what you are looking for, posted below:

    Please Login or Register  to view this content.
    Find unique street texts by going to Data -> Remove Duplicates, then use the UDF to find each post code associated.

    To add UDF:
    1) alt+f11 to open visual basic
    2) insert->module
    3) Paste code
    4) Close Visual Basic

    To run, just type =lookupconcat(

    The first variable is the one you are referencing i.e. a single street_text
    Second variable is the column you are referencing from (your column A)
    Third variable is return column (column B)
    Fourth variable is the delimiter, i.e. what goes between the returned results. Use CHAR(10) to return in a paragraph with each postcode separated by a line break, or use " " to put a space between results.
    Fifth Variable = TRUE (match the whole cell you are referencing, i.e. full street name)
    Sixth Variable = TRUE (uniques only)

    The code is referenced within. Click the link for more details.

  3. #3
    Registered User
    Join Date
    03-12-2014
    Location
    uk
    MS-Off Ver
    MAC 2011
    Posts
    5

    Re: Remove duplicates from column 1 and concatenate column 2 - is this possible?

    POPTCORN - Many thanks. Where and when do I type "=lookupconcat(" should all the cells be selected? Sorry but Excel is still a dark art to me...
    Last edited by Really Simple; 03-13-2014 at 05:59 AM.

  4. #4
    Registered User
    Join Date
    06-30-2011
    Location
    Toronto
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: Remove duplicates from column 1 and concatenate column 2 - is this possible?

    Just type it in a cell just like you would a normal function (e.g. =sum() ). The first variable should be the street for which you are looking for all the post codes, the second variable should be the list of streets, the third variable should be the full column of postcodes.

    Does that make sense? Did you manage to add the UDF?

  5. #5
    Registered User
    Join Date
    06-30-2011
    Location
    Toronto
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: Remove duplicates from column 1 and concatenate column 2 - is this possible?

    I have attached the solved file - keep in my that you might want to turn excel auto-calculation off because this UDF may slow down

    Let me know if this works
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    03-12-2014
    Location
    uk
    MS-Off Ver
    MAC 2011
    Posts
    5

    Re: Remove duplicates from column 1 and concatenate column 2 - is this possible?

    POPTCORN - Many thanks, I was offline and didn't get chance to thank you in a timely manner!

+ 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] Find duplicates, concatenate into different column, sum and delete duplicates
    By rosannang in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-17-2013, 11:23 AM
  2. Remove duplicates on column A and merge rows in column B
    By JJcool in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-29-2012, 05:41 PM
  3. Remove duplicates from workbook column by column
    By nzflapper in forum Excel General
    Replies: 0
    Last Post: 08-21-2011, 07:53 PM
  4. How to remove duplicates from a column
    By LLocal in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-13-2009, 05:44 PM
  5. How to remove duplicates from a column
    By wali in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-14-2008, 11:33 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