+ Reply to Thread
Results 1 to 10 of 10

Changing the name of 100 entries out of a list with 20,000 entries

  1. #1
    Registered User
    Join Date
    06-15-2010
    Location
    Athens, GA
    MS-Off Ver
    Excel 2007
    Posts
    22

    Changing the name of 100 entries out of a list with 20,000 entries

    Hi,

    I have a list with approx. 20,000 entries. Most of the entries in the list appear 4 times which is what I want. However, there are also about 100 entries, that appear 8, 12 or 20 times. I want to change the names of these additional repeats:
    Repeat 1-4 of a specific entry should not be changed. Entry 5-8 should recieve an "A" at the end of their description in column A. If present, entry 9-12 should recieve a "B",...

    It is important that the order of the list is not changed.

    Is that possible with Excel?

    Thanks

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Changing the name of 100 entries out of a list with 20,000 entries

    If your data is in A column try this in B:

    =A1&SUBSTITUTE(CHAR(64+ROUNDUP(COUNTIF($A$1:A1,A1)/4,0)-1),"@","")
    Attached Files Attached Files
    Last edited by zbor; 08-04-2010 at 01:52 PM.

  3. #3
    Registered User
    Join Date
    06-15-2010
    Location
    Athens, GA
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Changing the name of 100 entries out of a list with 20,000 entries

    Impressive. That worked. Thanks so much.
    Is there also a way to change the formula so that instead of adding A,B,C,D it adds W,X,Y,Z?

  4. #4
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Changing the name of 100 entries out of a list with 20,000 entries

    Zbor, Unfortunately your formula won't solve this issue. In your example you have 108 instances of "test". Some of them concatenated with "L", onother ones with "K" ... don't know and with other letters, whereas all of "test"s had to be concatenated with the same letter. But as I understood, OP wants to concatenate single letter for the all values. For example in Column A you have 108 instances of my name (Vusal). So all of them must be concatenated with appropriate letter. For example "D".

    Maybe it's not the way of macro writing but nothing another came up to my mind

    Please Login or Register  to view this content.
    How to use:
    1. Copy above code.
    2. In Excel press Alt + F11 to enter the VBE.
    3. Press Ctrl + R to show the Project Explorer.
    4. Choose Insert -> Module.
    5. Paste code into the right pane.
    6. Press Alt + Q to close the VBE.
    7. Save workbook before any other changes.
    Last edited by contaminated; 08-04-2010 at 02:46 PM.
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Changing the name of 100 entries out of a list with 20,000 entries

    Quote Originally Posted by benjamings View Post
    Impressive. That worked. Thanks so much.
    Is there also a way to change the formula so that instead of adding A,B,C,D it adds W,X,Y,Z?
    Sure... Just play with number 64 in formula and write some bigger one...

    For example:

    =A1&SUBSTITUTE(CHAR(86+ROUNDUP(COUNTIF($A$1:A1,A1)/4,0)-1),"V","")

    Will give you W as first one (also change @ to prior character of W which is V)

    Note that there shouldn't be more than 4 instances or after WXYZ you'll get :
    Please Login or Register  to view this content.
    Last edited by zbor; 08-04-2010 at 06:25 PM.

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Changing the name of 100 entries out of a list with 20,000 entries

    contaminated, not every word with same letter...
    As I understood:

    Repeat 1-4 of a specific entry should not be changed.
    Entry 5-8 should recieve an "A" at the end of their description in column A.
    If present, entry 9-12 should recieve a "B",...

    therefore, every 4: testA, testB, testC, testD etc.

  7. #7
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Changing the name of 100 entries out of a list with 20,000 entries

    Quote Originally Posted by zbor View Post
    contaminated, not every word with same letter...
    As I understood:

    Repeat 1-4 of a specific entry should not be changed.
    Entry 5-8 should recieve an "A" at the end of their description in column A.
    If present, entry 9-12 should recieve a "B",...

    therefore, every 4: testA, testB, testC, testD etc.
    you're right. Now I see that... sorry for misunderstanding (((

  8. #8
    Registered User
    Join Date
    06-15-2010
    Location
    Athens, GA
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Changing the name of 100 entries out of a list with 20,000 entries

    Perfect. Thanks so much.

  9. #9
    Registered User
    Join Date
    06-15-2010
    Location
    Athens, GA
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Changing the name of 100 entries out of a list with 20,000 entries

    Contaminated, thanks anyway. Hope it didn't cost you too much time :-)

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Changing the name of 100 entries out of a list with 20,000 entries

    A little upgrade... Don't know where I was looking...
    Instead of changing @ to V you can always use:

    =A1&SUBSTITUTE(CHAR(86+ROUNDUP(COUNTIF($A$1:A1;A1)/4;0)-1);CHAR(86);"")

    Using same number will remove you a first character...

+ 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