+ Reply to Thread
Results 1 to 19 of 19

Automatic Sequential Number with Condition

  1. #1
    Forum Contributor
    Join Date
    04-18-2016
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    178

    Automatic Sequential Number with Condition

    Hello All,
    I have a requirement to find the next available number in the same column and to fill up automatically. For example in the same column if CR-FI-1 & CR-FI-2 exist, the system should propose the next number as CR-FI-3. Now the issue is in Column C, we have already data which we don't want to disturb. I want the system to check the column 'D' and propose from the row 101 onwards.

    Sample file attached.

    Thanks in advance,
    Regards,
    Gem
    Attached Files Attached Files

  2. #2
    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,370

    Re: Automatic Sequential Number with Condition

    So what value to expect in 101 given that the sequence (to date) depends on the count of Codes in Column E?

  3. #3
    Forum Contributor
    Join Date
    04-18-2016
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    178

    Re: Automatic Sequential Number with Condition

    Sorry, not from 101. It should be from 103. Assume if I enter indicator as 'CR' and Function short name as 'PSM' in row 103, the column B show result as 'CR-PSM-49' instead of CR-PSM-37 which is coming now. The last available is CR-PSM-48.

    Quote Originally Posted by JohnTopley View Post
    So what value to expect in 101 given that the sequence (to date) depends on the count of Codes in Column E?

  4. #4
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Automatic Sequential Number with Condition

    Change the formula. Try with this in "B2" & copy down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  5. #5
    Forum Contributor
    Join Date
    04-18-2016
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    178

    Re: Automatic Sequential Number with Condition

    Hi AVK,
    I have tried your formula.. The column B should propose the next sequential number which is not proposing now. Check the attached file.

    Quote Originally Posted by avk View Post
    Change the formula. Try with this in "B2" & copy down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    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,370

    Re: Automatic Sequential Number with Condition

    The issue is that we need to find the last old sequence for each combination of "Indicator" and "Short Function name" e.g CR-PSM-48: given the list in C is "random", I cannot think of a search/match function to find these.

    And having found them, the same formula will be needed for every sequence update. We cannot use the COUNTIF function as used in the old sequence.

    Not a good idea to have "disturbed" the old sequence!

  7. #7
    Forum Contributor
    Join Date
    04-18-2016
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    178

    Re: Automatic Sequential Number with Condition

    Hi John & AVK,
    Any headsup?

  8. #8
    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,370

    Re: Automatic Sequential Number with Condition

    Some limited progress ..

    this formula finds the last (highest) value for a given "Indicator"/"Short Name"

    =IF(D101="","",INDEX(C2:C100,MAX(IF((LEFT(C2:C100,6)=D101&"-"&E101)*(ROW(C2:C100)),ROW(C2:C100)-1))))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    It then has to modified to find the digits at the end and then add 1 so it is going to be a "nightmare".

    A possible solution is the have a table which has the last value for a given combination and we use a "lookup" to get the next value.

    See attached: table in H1:K7
    Attached Files Attached Files
    Last edited by JohnTopley; 05-10-2017 at 02:42 AM.

  9. #9
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Automatic Sequential Number with Condition

    Let me confirm 103 : Is it sheet row number or your "SN" number.

  10. #10
    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,370

    Re: Automatic Sequential Number with Condition

    103 is "SN" number in row 101

  11. #11
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Automatic Sequential Number with Condition

    Yes Dear John agree (for your Post #8 attachment file).
    "Gembox" statement : He say Automatci sequence number with condition, but my point is why break the link from SN 103 any logic behind. Because original ID already created. I think there is no need to create new ID.

    In addition if we go as per "Gembox" : plz Look into column "C10" & "C11" (ID CR-PSM-3 & CR-PSM-5 respectively). If, in future, ID genrated without continuty i.e. CR-PSM-4 then, as per "Gemox" calculation new id is CR-PSM-37. Logically what is co-relation between original ID : CR-PSM-4 & new ID : CR-PSM-37. What is advantage.

  12. #12
    Forum Contributor
    Join Date
    04-18-2016
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    178

    Re: Automatic Sequential Number with Condition

    Hi AVK,
    The entries in column 'C' are created manually and being assigned and used for tracking purpose. In order to automate, I have inserted a new column 'B' and starting from SN 103 the formula should check the last serial number from the existing entries in column 'C' and should generate with next available serial number without disturbing the old ones.

    Quote Originally Posted by avk View Post
    Yes Dear John agree (for your Post #8 attachment file).
    "Gembox" statement : He say Automatci sequence number with condition, but my point is why break the link from SN 103 any logic behind. Because original ID already created. I think there is no need to create new ID.

    In addition if we go as per "Gembox" : plz Look into column "C10" & "C11" (ID CR-PSM-3 & CR-PSM-5 respectively). If, in future, ID genrated without continuty i.e. CR-PSM-4 then, as per "Gemox" calculation new id is CR-PSM-37. Logically what is co-relation between original ID : CR-PSM-4 & new ID : CR-PSM-37. What is advantage.
    Last edited by GemBox; 05-10-2017 at 05:10 AM.

  13. #13
    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,370

    Re: Automatic Sequential Number with Condition

    Now confused: in column B of "Sample8" file the last CR-PSM is "CR-PSM-56" so if we cannot start at "CR-PSM-48" .

  14. #14
    Forum Contributor
    Join Date
    04-18-2016
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    178

    Re: Automatic Sequential Number with Condition

    John,
    Ignore the values in Column 'B' from SN 1 to 102 (we can make it blank). Start fresh from SN 103.
    Quote Originally Posted by JohnTopley View Post
    Now confused: in column B of "Sample8" file the last CR-PSM is "CR-PSM-56" so if we cannot start at "CR-PSM-48" .

  15. #15
    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,370

    Re: Automatic Sequential Number with Condition

    The only solution I have devised is to have a table with the LAST value for combination and use a combination of VLOOKUP/COUNTIF to derive the sequence number.

    in C101

    =IF($D101="","",($D101&"-"&$E101&"-"&VLOOKUP($D101&"-"&$E101,$J$2:$L$100,3,0)+1))
    Attached Files Attached Files

  16. #16
    Forum Contributor
    Join Date
    04-18-2016
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    178

    Re: Automatic Sequential Number with Condition

    Thanks much for your effort John, you have spent lot of time in this thread. I'll simulate your formula in my main sheet and let you know the result...

  17. #17
    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,370

    Re: Automatic Sequential Number with Condition

    Appreciate your feedback: thank you. I'll await the results!

  18. #18
    Forum Contributor
    Join Date
    04-18-2016
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    178

    Re: Automatic Sequential Number with Condition

    Thanks much John.. It works perfectly.. Sorry for my delayed reply, I was out of station...

    Quote Originally Posted by JohnTopley View Post
    Appreciate your feedback: thank you. I'll await the results!

  19. #19
    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,370

    Re: Automatic Sequential Number with Condition

    No problem: glad to read that all is OK.

+ 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. Automatic Sequential Number
    By GemBox in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-23-2017, 06:29 AM
  2. [SOLVED] Automatic sequential count of entries in a month?
    By ChandlerSA in forum Excel General
    Replies: 3
    Last Post: 07-06-2016, 01:09 PM
  3. automatic sequential numbering for forms
    By Geez in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-15-2011, 01:28 AM
  4. [SOLVED] automatic sequential number on invoice or shippers
    By jeannene in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-06-2005, 09:05 PM
  5. Replies: 1
    Last Post: 04-15-2005, 04:06 PM
  6. [SOLVED] automatic sequential numbering in excel or word
    By greg2 in forum Excel General
    Replies: 1
    Last Post: 01-15-2005, 02:06 PM
  7. [SOLVED] Automatic Sequential renumbering within formulas
    By Task Lead Nicole in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-07-2005, 08:06 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