+ Reply to Thread
Results 1 to 4 of 4

Formula to assign consecutive sub IDs to parent IDs like example below?

  1. #1
    Registered User
    Join Date
    10-21-2021
    Location
    canada
    MS-Off Ver
    2021
    Posts
    2

    Formula to assign consecutive sub IDs to parent IDs like example below?

    I am trying to find a formula that can add consecutive sub numbers to a parent id then reset when there is a new parent id like example below. I need it to be flexible so that it's not just limited to one sequence.

    Does anyone know how to do this? You're an absolute rockstar if you can help me figure this out

    Parent IDs Sub IDs
    21-44-003 21-44-003-001
    21-44-003 21-44-003-002
    21-44-003 21-44-003-003
    21-44-004 21-44-004-001
    21-44-004 21-44-004-002
    21-44-004 21-44-004-003
    21-44-008 21-44-008-001
    21-44-008 21-44-008-002
    21-44-008 21-44-008-003
    21-44-008 21-44-008-004
    21-44-008 21-44-008-005
    21-44-009 21-44-009-001
    21-44-009 21-44-009-002
    21-44-009 21-44-009-003
    21-44-009 21-44-009-004
    21-44-009 21-44-009-005
    21-44-009 21-44-009-006
    21-44-009 21-44-009-007

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: Formula to assign consecutive sub IDs to parent IDs like example below?

    I can't test this out as you haven't attached a sample Excel workbook (see yellow banner at the top of the screen for details of how to), but try this in B2:

    =IF(A2="","",A2&"-"&TEXT(COUNTIF(A$2:A2,A2),"000"))

    Copy down to the bottom of your list, or beyond.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    10-21-2021
    Location
    canada
    MS-Off Ver
    2021
    Posts
    2

    Re: Formula to assign consecutive sub IDs to parent IDs like example below?

    Quote Originally Posted by Pete_UK View Post
    I can't test this out as you haven't attached a sample Excel workbook (see yellow banner at the top of the screen for details of how to), but try this in B2:

    =IF(A2="","",A2&"-"&TEXT(COUNTIF(A$2:A2,A2),"000"))

    Copy down to the bottom of your list, or beyond.

    Hope this helps.

    Pete
    WOW NICE! IT WORKS PERFECTLY

    YOU'RE A MIRACLE WORKER - I've been stuck on this for a while now.

    THANK YOU SO MUCH!

    Dav

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: Formula to assign consecutive sub IDs to parent IDs like example below?

    Glad to help, and thanks for the rep.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.


    Pete

+ 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 finds the max number of consecutive times and the Total of consecutive values
    By rayhen in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-01-2021, 03:06 AM
  2. [SOLVED] Assign parent sheet to UDF function
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-27-2016, 02:59 PM
  3. Macro to count consecutive blank cells and assign a number
    By voitoosh in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-08-2013, 03:24 AM
  4. [SOLVED] Macro that would loop through duplicated project name and assign consecutive ID
    By Jackkk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-13-2012, 10:32 AM
  5. Replies: 0
    Last Post: 12-12-2012, 06:35 PM
  6. Module to assign parent part to bill of materials
    By Tom_K! in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-25-2011, 12:49 AM
  7. Assign a date to a record for consecutive days
    By Brooke in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-24-2006, 04:20 PM

Tags for this Thread

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