+ Reply to Thread
Results 1 to 5 of 5

Help request to create a unique id by macro or formula

  1. #1
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Help request to create a unique id by macro or formula

    Hi friends,

    I want to give a unique ID to each person.
    It should be given alphabetically.
    Column ‘D’ contains surname.
    Column ‘H’ contains ID.
    If the surname starts with a letter ‘A’ then a ID should start with a letter ‘A0001’
    Second time If the surname starts with a letter ‘A’ then a ID should start with a letter ‘A0002’ and so on …


    If the surname starts with a letter ‘B’ then a ID should start with a letter ‘B0001’
    Second time If the surname starts with a letter ‘B’ then a ID should start with a letter ‘B0002’ and so on …


    It should be same for each letter from A to Z respectively.

    Please suggest me solution macro or formula.

    Thanking you in anticipation.
    Attached Files Attached Files
    Sincerely,

    mso3

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,937

    Re: Help request to create a unique id by macro or formula

    Try
    H8=LEFT(D8,1)&"000"&SUM(1*((LEFT($D$8:D8,1)=LEFT(D8,1)))) with CTRL+SHIFT+ENTER and drag down

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by shukla.ankur281190; 10-24-2015 at 07:53 AM.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,511

    Re: Help request to create a unique id by macro or formula

    Try ..

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by JohnTopley; 10-24-2015 at 06:54 AM.

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,496

    Re: Help request to create a unique id by macro or formula

    Try:

    =LEFT(D8,1)&TEXT(SUMPRODUCT(--(CODE($D$8:D8)=CODE(D8))),"0000")
    Drag down
    Quang PT

  5. #5
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Help request to create a unique id by macro or formula

    Hi all,

    Perfect! All the formulas are working fine.

    I appreciate you for the same.

    Thank you and have a nice time.
    Last edited by mso3; 10-24-2015 at 08:06 AM.

+ 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. [SOLVED] Formula request for unique entries
    By mso3 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-08-2014, 08:41 PM
  2. Max Date with Unique Name - Updated Request
    By [email protected] in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-01-2012, 12:20 PM
  3. Replies: 7
    Last Post: 05-17-2012, 03:08 AM
  4. Macro request: Create and Search two sets; return number of duplicates
    By Breex243 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2010, 05:46 PM
  5. Replies: 3
    Last Post: 03-29-2010, 10:07 PM
  6. How can I request to create a new Formula?
    By Eckhard in forum Excel General
    Replies: 0
    Last Post: 09-02-2005, 06:05 AM
  7. Replies: 2
    Last Post: 02-28-2005, 11:06 AM

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