How do I create a unique id in Excel using multiple columns?

by on May 3, 2010

Q: I am working on a Mac OS X with data in MS Excel that need to be modified. In field A, I have ID numbers that are not currently unique. The records are unique when the ID number is paired with an Event number in field B. To make the ID numbers unique on their own, I want to combine part of the Event number with the ID number for each record. This could be done in large portions of the data at once b/c there are fewer than 10 different Event numbers and the data could be sorted easily. So, I am wondering if it is possible to write a script, etc, to automate the addition of 4 characters to the end of each ID number for a selected portion of the data.


One Response to “How do I create a unique id in Excel using multiple columns?”
  1.  
    Picked as best answer

    Let’s say you had cell A1 with ‘abcdef’ and B1 had ‘123456’. You can use formula of =CONCATENATE(LEFT(A1,3),LEFT(B1,3)) to take the first three characters of each field and put them together resulting in ‘abc123’.