+ Reply to Thread
Results 1 to 6 of 6

assigning unique id's to duplicate records

  1. #1
    Registered User
    Join Date
    01-12-2009
    Location
    Fareham
    MS-Off Ver
    Excel 2003
    Posts
    2

    assigning unique id's to duplicate records

    I have a sheet with address data:

    company1 address1 address2 address3 product1
    company1 address1 address2 address3 product2
    company1 address1 address2 address3 product3
    company2 address1 address2 address3 product2
    company2 address1 address2 address3 product4

    etc.

    I need to assign a unique id to each unique company so that I end up with:
    001 company1 address1 address2 address3 product1
    001 company1 address1 address2 address3 product2
    001 company1 address1 address2 address3 product3
    002 company2 address1 address2 address3 product2
    002 company2 address1 address2 address3 product4


    I have tried using the advance filter to hide the duplicates, but then I can't find a way to set the id on each record (including the hidden ones). My file has about 40,000 records so need to automate this somehow.

    Steve

  2. #2
    Valued Forum Contributor Shijesh Kumar's Avatar
    Join Date
    05-26-2008
    Location
    Bangalore / India
    MS-Off Ver
    2000
    Posts
    717
    There are several ways to achieve this...

    One of them would be:

    Make a list of all the company in another sheet . ( You can use advance filter feature - copy unique record to do this ).

    Assign unique ID .. You may assign first company ID 001 , Second company ID 002 and drag it down ..

    Now use Vlookup function to populate the ID.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Assuming your data starts in A2 to E2, with headers in Row 1, then try:

    In F2,

    =TEXT(IF(A2=A1,F1,F1+1),"000")

    copied down.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    01-12-2009
    Location
    Fareham
    MS-Off Ver
    Excel 2003
    Posts
    2
    This is fine except that it is possible for the Company name to be the same when the address is different and so in this case a new ID would be required, so it needs to check on the whole record and not just the company name.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You mean then?

    =TEXT(IF(A2&B2&C2&D2=A1&B1&C1&D1,F1,F1+1),"000")

  6. #6
    Registered User
    Join Date
    11-03-2008
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    2,521

    Need more clarity

    Quote Originally Posted by stevefsm View Post
    I have a sheet with address data:

    company1 address1 address2 address3 product1
    company1 address1 address2 address3 product2
    company1 address1 address2 address3 product3
    company2 address1 address2 address3 product2
    company2 address1 address2 address3 product4

    etc.

    I need to assign a unique id to each unique company so that I end up with:
    001 company1 address1 address2 address3 product1
    001 company1 address1 address2 address3 product2
    001 company1 address1 address2 address3 product3
    002 company2 address1 address2 address3 product2
    002 company2 address1 address2 address3 product4


    I have tried using the advance filter to hide the duplicates, but then I can't find a way to set the id on each record (including the hidden ones). My file has about 40,000 records so need to automate this somehow.

    Steve
    Are the duplicates based only on Company Name, Add1 Add2 and Add3 and not on Prod? as shown in the above example

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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