+ Reply to Thread
Results 1 to 4 of 4

How to add letter to duplicated line to create unique entry

  1. #1
    Registered User
    Join Date
    04-17-2017
    Location
    Lake Forest, California
    MS-Off Ver
    2010
    Posts
    2

    How to add letter to duplicated line to create unique entry

    Hello there,

    I am working with Excel 2010 and am trying to add a letter to a duplicate line. I found a formula that gets me a number and that is where I get stuck.

    This is the formula:

    =C2&IF(COUNTIF($C$2:C2,C2)=1,"",COUNTIF($C$2:C2,C2)-1)

    The results are:

    2345
    3333
    33331
    33332
    3456

    What I need is:

    2345
    3333
    3333A
    3333B
    3456

    Thank you in advance for the help.

  2. #2
    Registered User
    Join Date
    08-28-2015
    Location
    Melbourne, AUS
    MS-Off Ver
    2011
    Posts
    59

    Re: How to add letter to duplicated line to create unique entry

    Are the numbers always 4 long or 5 long when they have the extra digit you want to identify?

    If so, then.

    =IF(LEN(C2)=5,LEFT(C2,4)&IF(RIGHT(C2,1)=1,"A",IF(RIGHT(C2,1)=2,"B",IF(RIGHT(C2,1)=3,"C",IF(RIGHT(C2,1)=4,"D",IF(RIGHT(C2,1)=5,"E",IF(RIGHT(C2,1)=6,"F",IF(RIGHT(C2,1)=7,"G",IF(RIGHT(C2,1)=8,"H",IF(RIGHT(C2,1)=9,"I",""))))))))),C2)
    Last edited by mrshl9898; 04-17-2017 at 07:22 PM.

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: How to add letter to duplicated line to create unique entry

    How about...

    =C2&IF(COUNTIF($C$2:C2,C2)=1,"",CHAR(COUNTIF($C$2:C2,C2)-1+64))
    Last edited by jeffreybrown; 04-17-2017 at 07:32 PM.
    HTH
    Regards, Jeff

  4. #4
    Registered User
    Join Date
    04-17-2017
    Location
    Lake Forest, California
    MS-Off Ver
    2010
    Posts
    2

    Talking Re: How to add letter to duplicated line to create unique entry

    Thank you Jeff,

    That worked perfect in my sample data. I will test it with our client data tomorrow.

    To mrshl9898,

    The data length changes in the column. It is for part numbers that are going to be imported.

    Thanks again,

    Don

+ 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. Create new worksheet automatically for each Line of entry
    By henryBukowski in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-25-2015, 10:51 AM
  2. Replies: 10
    Last Post: 03-28-2014, 03:33 PM
  3. Chemical Inventory- Create unique number for each entry to label
    By wijoga in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-17-2013, 12:33 PM
  4. Replies: 1
    Last Post: 12-31-2012, 05:31 AM
  5. Create two line journal entry from one line, two different column for debit & credit
    By ditto135 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2011, 03:01 PM
  6. Replies: 5
    Last Post: 01-12-2011, 08:49 AM
  7. Create two line journal entry out of one line
    By redwine in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 12-17-2010, 03:42 PM

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