+ Reply to Thread
Results 1 to 7 of 7

Need to automate unique identifier

  1. #1
    MLK
    Guest

    Need to automate unique identifier

    I have a file containing resources and a resource could be listed multiple
    times. Their user ID is a key for reporting, but of course this is listed
    multiple times as well.

    To handle this currently, another column was inserted with their IDs copied
    into it. If a user is listed more than once, than a letter is appended to
    their user ID to make it unique. For example: smithj is listed on 3 rows
    and the IDs would appear as : smithj, smithjx, smithjy (where the x and y
    are appended to subsequent lines).

    Is there a way to automate appending a letter to the user ID? Typically a
    resource wouldnt have more than 4 lines, so Im only looking to append x,
    y and z.


  2. #2
    Max
    Guest

    Re: Need to automate unique identifier

    Assuming source data running in A2 down,

    Place in B2:
    =IF(A2="","",IF(COUNTIF($A$2:A2,A2)=1,A2,IF(COUNTIF($A$2:A2,A2)=2,A2&"x",IF(COUNTIF($A$2:A2,A2)=3,A2&"y",IF(COUNTIF($A$2:A2,A2)=4,A2&"z","ID over 4 x")))))
    Copy B2 down as far as required

    Any IDs appearing more than 4 times will be flagged: ID over 4 x
    --
    Max
    Singapore
    http://savefile.com/projects/236895
    xdemechanik
    ---
    "MLK" wrote:
    > I have a file containing resources and a resource could be listed multiple
    > times. Their user ID is a key for reporting, but of course this is listed
    > multiple times as well.
    >
    > To handle this currently, another column was inserted with their ID’s copied
    > into it. If a user is listed more than once, than a letter is appended to
    > their user ID to make it unique. For example: smithj is listed on 3 rows
    > and the ID’s would appear as : smithj, smithjx, smithjy (where the x and y
    > are appended to subsequent lines).
    >
    > Is there a way to automate appending a letter to the user ID? Typically a
    > resource wouldn’t have more than 4 lines, so I’m only looking to append “x”,
    > “y” and “z”.
    >


  3. #3
    Biff
    Guest

    Re: Need to automate unique identifier

    Here's another one:

    =IF(A2="","",A2&LOOKUP(COUNTIF(A$2:A2,A2),{1,2,3,4,5},{"","x","y","z","++"}))

    Biff

    "Max" <demechanik@yahoo.com> wrote in message
    news:0FD7163E-1BBE-45B9-AD27-13F6DDFB669C@microsoft.com...
    > Assuming source data running in A2 down,
    >
    > Place in B2:
    > =IF(A2="","",IF(COUNTIF($A$2:A2,A2)=1,A2,IF(COUNTIF($A$2:A2,A2)=2,A2&"x",IF(COUNTIF($A$2:A2,A2)=3,A2&"y",IF(COUNTIF($A$2:A2,A2)=4,A2&"z","ID
    > over 4 x")))))
    > Copy B2 down as far as required
    >
    > Any IDs appearing more than 4 times will be flagged: ID over 4 x
    > --
    > Max
    > Singapore
    > http://savefile.com/projects/236895
    > xdemechanik
    > ---
    > "MLK" wrote:
    >> I have a file containing resources and a resource could be listed
    >> multiple
    >> times. Their user ID is a key for reporting, but of course this is
    >> listed
    >> multiple times as well.
    >>
    >> To handle this currently, another column was inserted with their ID's
    >> copied
    >> into it. If a user is listed more than once, than a letter is appended
    >> to
    >> their user ID to make it unique. For example: smithj is listed on 3
    >> rows
    >> and the ID's would appear as : smithj, smithjx, smithjy (where the x and
    >> y
    >> are appended to subsequent lines).
    >>
    >> Is there a way to automate appending a letter to the user ID? Typically
    >> a
    >> resource wouldn't have more than 4 lines, so I'm only looking to append
    >> "x",
    >> "y" and "z".
    >>




  4. #4
    MLK
    Guest

    Re: Need to automate unique identifier

    Great! Thank you.

    "Max" wrote:

    > Assuming source data running in A2 down,
    >
    > Place in B2:
    > =IF(A2="","",IF(COUNTIF($A$2:A2,A2)=1,A2,IF(COUNTIF($A$2:A2,A2)=2,A2&"x",IF(COUNTIF($A$2:A2,A2)=3,A2&"y",IF(COUNTIF($A$2:A2,A2)=4,A2&"z","ID over 4 x")))))
    > Copy B2 down as far as required
    >
    > Any IDs appearing more than 4 times will be flagged: ID over 4 x
    > --
    > Max
    > Singapore
    > http://savefile.com/projects/236895
    > xdemechanik
    > ---
    > "MLK" wrote:
    > > I have a file containing resources and a resource could be listed multiple
    > > times. Their user ID is a key for reporting, but of course this is listed
    > > multiple times as well.
    > >
    > > To handle this currently, another column was inserted with their ID’s copied
    > > into it. If a user is listed more than once, than a letter is appended to
    > > their user ID to make it unique. For example: smithj is listed on 3 rows
    > > and the ID’s would appear as : smithj, smithjx, smithjy (where the x and y
    > > are appended to subsequent lines).
    > >
    > > Is there a way to automate appending a letter to the user ID? Typically a
    > > resource wouldn’t have more than 4 lines, so I’m only looking to append “x”,
    > > “y” and “z”.
    > >


  5. #5
    MLK
    Guest

    Re: Need to automate unique identifier

    Thanks!

    "Biff" wrote:

    > Here's another one:
    >
    > =IF(A2="","",A2&LOOKUP(COUNTIF(A$2:A2,A2),{1,2,3,4,5},{"","x","y","z","++"}))
    >
    > Biff
    >
    > "Max" <demechanik@yahoo.com> wrote in message
    > news:0FD7163E-1BBE-45B9-AD27-13F6DDFB669C@microsoft.com...
    > > Assuming source data running in A2 down,
    > >
    > > Place in B2:
    > > =IF(A2="","",IF(COUNTIF($A$2:A2,A2)=1,A2,IF(COUNTIF($A$2:A2,A2)=2,A2&"x",IF(COUNTIF($A$2:A2,A2)=3,A2&"y",IF(COUNTIF($A$2:A2,A2)=4,A2&"z","ID
    > > over 4 x")))))
    > > Copy B2 down as far as required
    > >
    > > Any IDs appearing more than 4 times will be flagged: ID over 4 x
    > > --
    > > Max
    > > Singapore
    > > http://savefile.com/projects/236895
    > > xdemechanik
    > > ---
    > > "MLK" wrote:
    > >> I have a file containing resources and a resource could be listed
    > >> multiple
    > >> times. Their user ID is a key for reporting, but of course this is
    > >> listed
    > >> multiple times as well.
    > >>
    > >> To handle this currently, another column was inserted with their ID's
    > >> copied
    > >> into it. If a user is listed more than once, than a letter is appended
    > >> to
    > >> their user ID to make it unique. For example: smithj is listed on 3
    > >> rows
    > >> and the ID's would appear as : smithj, smithjx, smithjy (where the x and
    > >> y
    > >> are appended to subsequent lines).
    > >>
    > >> Is there a way to automate appending a letter to the user ID? Typically
    > >> a
    > >> resource wouldn't have more than 4 lines, so I'm only looking to append
    > >> "x",
    > >> "y" and "z".
    > >>

    >
    >
    >


  6. #6
    Biff
    Guest

    Re: Need to automate unique identifier

    Even shorter but assumes no name repeats more than 5 times:

    >Typically a resource wouldn't have more than 4 lines


    =IF(A2="","",A2&CHOOSE(COUNTIF(A$2:A2,A2),"","x","y","z","++"))

    Biff

    "Biff" <biffinpitt@comcast.net> wrote in message
    news:%23zYa4XbxGHA.560@TK2MSFTNGP05.phx.gbl...
    > Here's another one:
    >
    > =IF(A2="","",A2&LOOKUP(COUNTIF(A$2:A2,A2),{1,2,3,4,5},{"","x","y","z","++"}))
    >
    > Biff
    >
    > "Max" <demechanik@yahoo.com> wrote in message
    > news:0FD7163E-1BBE-45B9-AD27-13F6DDFB669C@microsoft.com...
    >> Assuming source data running in A2 down,
    >>
    >> Place in B2:
    >> =IF(A2="","",IF(COUNTIF($A$2:A2,A2)=1,A2,IF(COUNTIF($A$2:A2,A2)=2,A2&"x",IF(COUNTIF($A$2:A2,A2)=3,A2&"y",IF(COUNTIF($A$2:A2,A2)=4,A2&"z","ID
    >> over 4 x")))))
    >> Copy B2 down as far as required
    >>
    >> Any IDs appearing more than 4 times will be flagged: ID over 4 x
    >> --
    >> Max
    >> Singapore
    >> http://savefile.com/projects/236895
    >> xdemechanik
    >> ---
    >> "MLK" wrote:
    >>> I have a file containing resources and a resource could be listed
    >>> multiple
    >>> times. Their user ID is a key for reporting, but of course this is
    >>> listed
    >>> multiple times as well.
    >>>
    >>> To handle this currently, another column was inserted with their ID's
    >>> copied
    >>> into it. If a user is listed more than once, than a letter is appended
    >>> to
    >>> their user ID to make it unique. For example: smithj is listed on 3
    >>> rows
    >>> and the ID's would appear as : smithj, smithjx, smithjy (where the x and
    >>> y
    >>> are appended to subsequent lines).
    >>>
    >>> Is there a way to automate appending a letter to the user ID? Typically
    >>> a
    >>> resource wouldn't have more than 4 lines, so I'm only looking to append
    >>> "x",
    >>> "y" and "z".
    >>>

    >
    >




  7. #7
    Max
    Guest

    Re: Need to automate unique identifier

    You're welcome, and thanks for calling back.
    --
    Max
    Singapore
    http://savefile.com/projects/236895
    xdemechanik
    ---
    "MLK" wrote:
    > Great! Thank you.


+ 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