+ Reply to Thread
Results 1 to 22 of 22

Auto Numbering

  1. #1
    Forum Contributor
    Join Date
    03-23-2015
    Location
    Manila, Philippines
    MS-Off Ver
    2016
    Posts
    201

    Auto Numbering

    Hi Gurus,

    I would like to seek your help on getting my file to have an auto numbering system. Giving each row a Unique ID or Reference ID.
    Hoping that a specific format will auto fill on Unique ID column if Project Name column contains any value/text.
    I've tried searching on google but the one I saw would take 41 line codes to build.

    This is the format I'm going for:
    SMART-ISG-000001

    Here are some samples.

    Attachment 632476
    Last edited by EXCELBENCH; 07-17-2019 at 01:20 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,863

    Re: Auto Numbering

    To have these IDs permanently written into a sheet it's best to use VBA code. If one uses formula, then the number assigned to a particular project could change when another project is added.

    Try such code in the sheet module (not in general one):
    Please Login or Register  to view this content.
    Seems it's signifficantly less than 41 lines long :-)
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    12-22-2017
    Location
    INDIA
    MS-Off Ver
    EXCEL 2007
    Posts
    106

    Re: Auto Numbering

    Use this formula in A3

    =left(a2,15)&value(mid(a2,11,6)+1)

  4. #4
    Forum Contributor
    Join Date
    03-23-2015
    Location
    Manila, Philippines
    MS-Off Ver
    2016
    Posts
    201

    Re: Auto Numbering

    Quote Originally Posted by Kaper View Post
    To have these IDs permanently written into a sheet it's best to use VBA code. If one uses formula, then the number assigned to a particular project could change when another project is added.

    Try such code in the sheet module (not in general one):
    Please Login or Register  to view this content.
    Seems it's signifficantly less than 41 lines long :-)
    This is amazing! Really. But do you think we can do this without using VBA or Macro?

  5. #5
    Forum Contributor
    Join Date
    12-22-2017
    Location
    INDIA
    MS-Off Ver
    EXCEL 2007
    Posts
    106

    Re: Auto Numbering

    did you check this EXCELBENCH ?

  6. #6
    Forum Contributor
    Join Date
    12-22-2017
    Location
    INDIA
    MS-Off Ver
    EXCEL 2007
    Posts
    106

    Re: Auto Numbering

    Quote Originally Posted by chandy123987 View Post
    Use this formula in A3

    =left(a2,15)&value(mid(a2,11,6)+1)
    did you check this EXCELBENCH ?

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,653

    Re: Auto Numbering

    Have YOU checked it, Chandy123987? If you have, then you will know that it doesn't work - it returns a #VALUE! error.

    Excel 2016 (Windows) 32 bit
    A
    B
    C
    D
    1
    Unique ID Project Name
    2
    Alpha
    3
    #VALUE!
    Beta SMART-ISG-000001
    4
    #VALUE!
    Charlie SMART-ISG-000002
    5
    #VALUE!
    Douggie SMART-ISG-000003
    6
    #VALUE!
    SMART-ISG-000004
    7
    #VALUE!
    SMART-ISG-000005
    8
    #VALUE!
    SMART-ISG-000006
    9
    #VALUE!
    10
    #VALUE!
    11
    Sheet: Sheet1
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  8. #8
    Forum Contributor
    Join Date
    12-22-2017
    Location
    INDIA
    MS-Off Ver
    EXCEL 2007
    Posts
    106

    Re: Auto Numbering

    i checked this it is working Aligw

  9. #9
    Forum Contributor
    Join Date
    12-22-2017
    Location
    INDIA
    MS-Off Ver
    EXCEL 2007
    Posts
    106

    Re: Auto Numbering

    Pls check in the attachment
    Attached Files Attached Files

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,653

    Re: Auto Numbering

    No, it isn't. See my post above.

    Your formula refers to A2, which is blank.

  11. #11
    Forum Contributor
    Join Date
    12-22-2017
    Location
    INDIA
    MS-Off Ver
    EXCEL 2007
    Posts
    106

    Re: Auto Numbering

    ok agreed that

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,653

    Re: Auto Numbering

    Quote Originally Posted by chandy123987 View Post
    Pls check in the attachment
    In the attachment, you have added an entry in A2. You did not say that in your instructions.

    It's the same as your own thread asking for help: NOT ENOUGH DETAIL!!!

    Slow down and do things properly, please.

  13. #13
    Forum Contributor
    Join Date
    12-22-2017
    Location
    INDIA
    MS-Off Ver
    EXCEL 2007
    Posts
    106

    Re: Auto Numbering

    ok thanks for your advise

  14. #14
    Forum Contributor
    Join Date
    03-23-2015
    Location
    Manila, Philippines
    MS-Off Ver
    2016
    Posts
    201

    Re: Auto Numbering

    Quote Originally Posted by chandy123987 View Post
    Pls check in the attachment
    Sorry but this isn't what I'm looking for.
    I'm actually going for an auto populate whenever a new value/text are entered on the Project column.

  15. #15
    Registered User
    Join Date
    09-12-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2013
    Posts
    38

    Re: Auto Numbering

    So mr bench

    if you want a formula one that will work in A2 and copied down is =IF(B2<>"","SMART-ISG-"&TEXT(ROW()-1,"000000"),"")
    it will show nothing until there is a value in the project name. just have to copy it far enough down, or make your table a table then each row added will get the formula populated

    As mentioned by Kaper, if you use formulas for this sort of thing they are prone to cause variable results if =, for example, you add a row, the id numbers will remain with their rows rather than remaining with the project number. Also, in the use of your sheet, will a project name ever repeat? If it will this solution won't work.

    Hope this helps
    Ron

  16. #16
    Forum Contributor
    Join Date
    03-23-2015
    Location
    Manila, Philippines
    MS-Off Ver
    2016
    Posts
    201

    Re: Auto Numbering

    Yes sir. There would be same Project Names.
    Last edited by AliGW; 07-17-2019 at 12:48 AM. Reason: Please don't quote unnecessarily!

  17. #17
    Registered User
    Join Date
    09-12-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2013
    Posts
    38

    Re: Auto Numbering

    Well in that case
    put the first ID in manually in A2 then the following in a3 downwards
    =IF(B3="","",IF(ISNUMBER(MATCH(B3,$B$2:B2,0)),INDEX($A$2:$A2,MATCH(B3,$B$2:B2,0)),LEFT(A2,10)&TEXT(1+RIGHT(A2,6),"000000")))

    This will pick the ID used previously if the project number repeats.

    This is the additional information needed to get a solution that will work for you, problem with an overly simplified sample...

    Ron

  18. #18
    Forum Contributor
    Join Date
    03-23-2015
    Location
    Manila, Philippines
    MS-Off Ver
    2016
    Posts
    201

    Re: Auto Numbering

    Appreciate it Sir. I'll try this out.
    Last edited by AliGW; 07-17-2019 at 12:47 AM. Reason: Please don't quote unnecessarily!

  19. #19
    Forum Contributor
    Join Date
    03-23-2015
    Location
    Manila, Philippines
    MS-Off Ver
    2016
    Posts
    201

    Re: Auto Numbering

    It gives me random numbers.
    Supposed to be giving me unique numbers.
    Please check the file..
    Last edited by EXCELBENCH; 07-17-2019 at 01:20 AM.

  20. #20
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,653

    Re: Auto Numbering

    The numbers are not random:

    This will pick the ID used previously if the project number repeats.

  21. #21
    Forum Contributor
    Join Date
    03-23-2015
    Location
    Manila, Philippines
    MS-Off Ver
    2016
    Posts
    201

    Re: Auto Numbering

    The first formula he gave works. Thanks Sir rondeondon!

  22. #22
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,653

    Re: Auto Numbering

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Multi level reference id - auto numbering - similar to legal numbering
    By smsko in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-11-2017, 06:05 AM
  2. Excel 2007 : Auto Numbering Help
    By ranger007 in forum Excel General
    Replies: 5
    Last Post: 09-17-2011, 02:23 AM
  3. weird (auto numbering) numbering ....
    By freestone in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-20-2010, 07:46 PM
  4. Possible to do auto-numbering after auto filtering?
    By hello_lpc in forum Excel General
    Replies: 1
    Last Post: 11-10-2009, 03:18 AM
  5. WBS numbering help, auto numbering with indenture
    By hisham2929 in forum Excel General
    Replies: 2
    Last Post: 02-18-2007, 06:59 PM
  6. auto numbering
    By Joe Black in forum Excel General
    Replies: 2
    Last Post: 01-18-2006, 10:30 PM
  7. Auto Numbering
    By jharkins in forum Excel General
    Replies: 3
    Last Post: 07-28-2005, 08:05 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