+ Reply to Thread
Results 1 to 8 of 8

How to generate auto sequence number for repeating sets of array

  1. #1
    Registered User
    Join Date
    09-27-2018
    Location
    dehradun
    MS-Off Ver
    2007
    Posts
    3

    How to generate auto sequence number for repeating sets of array

    Can anyone guide me how to generate sequence number for n numbers of digits present in a excel column in the form of repeating arrays of "2", "1" and "4". For Example if the cell Range A2:A6 is having cell value as "2" then it should have a sequence of 1,2,3,4,5 likewise for A7:A12 having cell value as "4" then it should have a sequence of 1,2,3,4,5. For now i am able to generate the sequence number for the first set of array for each digit value "2" "4" and "1" by using COUNTIF like COUNTIF(A$2:A2,A2). The solution i am looking into is that for every set of array it should start the sequence from 1 and end at the total count of the digit value for that set of array. Auto-Sequnce-Number.xls is attached herewith for reference.
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: How to generate auto sequence number for repeating sets of array

    There is a mistake in your expected answer from B17 down, I think. B17 should read 1 and not 5...


    =IF(A2<>A1,1,C1+1)

    copied down
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: How to generate auto sequence number for repeating sets of array

    Here's the file...
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    09-27-2018
    Location
    dehradun
    MS-Off Ver
    2007
    Posts
    3

    Re: How to generate auto sequence number for repeating sets of array

    Thank you Glenn for your answer and yes you are right B17 should read 1 and not 5. The solution you provided is working fine for the given scenario but their is slightly misinterpretation of the input fields. Actually the column "C" contains the sequence number generated by me by using COUNTIF which is not the result i want. The result i want is that the formula take input value from column "A" and return the sequence number as result in any desired column of excel.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: How to generate auto sequence number for repeating sets of array

    I do not understand what you mean by "The result i want is that the formula take input value from column "A" and return the sequence number as result in any desired column of excel."

    I replaced the values in C with my formula.... there is no countif there at all any more (unless I attached the wrong file...)

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: How to generate auto sequence number for repeating sets of array

    Post a sheet showing me a real example of a situation where my formula DOES NOT work.

  7. #7
    Registered User
    Join Date
    09-27-2018
    Location
    dehradun
    MS-Off Ver
    2007
    Posts
    3

    Re: How to generate auto sequence number for repeating sets of array

    My sincere apologies. The solution provided earlier is working fine. Thanks a lot for your help.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: How to generate auto sequence number for repeating sets of array

    You're welcome.



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

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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] Need help adapting a formula to generate a random array of non-repeating numbers
    By MalibuLX3 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-11-2016, 08:56 AM
  2. How to auto generate sequence number
    By FelicityCSaycon in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-13-2013, 08:38 AM
  3. [SOLVED] Insert missing rows into repeating number sequence
    By budgie300 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-12-2012, 06:17 PM
  4. [SOLVED] generate sequence of number
    By cyzax7 via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2006, 04:00 AM
  5. How do I check repeating sets of number in a range
    By Tshidiso in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  6. [SOLVED] How do I check repeating sets of number in a range
    By Tshidiso in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-02-2005, 06:05 AM
  7. Repeating number sequence in a column
    By Nexan in forum Excel General
    Replies: 3
    Last Post: 03-31-2005, 03:06 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