+ Reply to Thread
Results 1 to 7 of 7

Need Solution on Creating Running/Sequence Number Based on Value

  1. #1
    Registered User
    Join Date
    08-23-2019
    Location
    Indonesia
    MS-Off Ver
    2010, 2019, 365
    Posts
    3

    Question Need Solution on Creating Running/Sequence Number Based on Value

    [SOLVED]
    Thanks a ton to the contributors :
    - Fluff13
    - JohnTopley

    Good Morning from GMT+7,

    I want to create this kind of running/continuous number based on values (which in my case are name/ID, date, and location).
    The current method that I've used to generate the code number is a simple COUNTIF formula, but when it finds the same value, the formula will skip to the next number.

    ex :
    No
    Name
    Date
    Location
    Generated Code
    (after VLOOKUP)
    What I Want
    1.
    ANDES
    03 May 2021
    Denmark ANDES-OUT #1 ANDES-OUT #1
    2.
    ANDES
    03 May 2021
    Denmark ANDES-OUT #1 ANDES-OUT #1
    3.
    ANDES
    03 May 2021
    London ANDES-OUT #3 ANDES-OUT #2

    The formula that I currently use for the generated code: B2&"-OUT #"&countif($B$2:B2,B2) ; and to call the data from another sheet using VLOOKUP.
    More details can be found in the attachment.

    Thanks
    Attached Files Attached Files
    Last edited by icol33; 05-23-2021 at 01:04 PM. Reason: The problem is solved

  2. #2
    Forum Contributor
    Join Date
    05-03-2021
    Location
    Nashville
    MS-Off Ver
    MS Office 365
    Posts
    189

    Re: Need Solution on Creating Running/Sequence Number Based on Value

    misread the request. sorry.
    Last edited by thenewkidd; 05-19-2021 at 09:19 PM. Reason: didn't fully understand

  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
    30,916

    Re: Need Solution on Creating Running/Sequence Number Based on Value

    In H3

    =IF(COUNTIF($B$3:$B3,$B3)=1,VLOOKUP($B3,Database!$B$3:$C$5,2,FALSE)&"-OUT-#1",IF(AND($B3=$B2,$D3=$D2,$C2=$C3),H2,LEFT(H2,9)&(--RIGHT(H2,1))+1))

    I don't have 365 so I am sure there is a smarter solution
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,789

    Re: Need Solution on Creating Running/Sequence Number Based on Value

    How about in J3 on the Database sheet
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    08-23-2019
    Location
    Indonesia
    MS-Off Ver
    2010, 2019, 365
    Posts
    3

    Re: Need Solution on Creating Running/Sequence Number Based on Value

    Quote Originally Posted by JohnTopley View Post
    In H3

    =IF(COUNTIF($B$3:$B3,$B3)=1,VLOOKUP($B3,Database!$B$3:$C$5,2,FALSE)&"-OUT-#1",IF(AND($B3=$B2,$D3=$D2,$C2=$C3),H2,LEFT(H2,9)&(--RIGHT(H2,1))+1))

    I don't have 365 so I am sure there is a smarter solution
    Hi John, it works like charm! It would be better if it’s located on the Database sheet, but yours too solved my question as well.
    Thanks thanks a lot!

  6. #6
    Registered User
    Join Date
    08-23-2019
    Location
    Indonesia
    MS-Off Ver
    2010, 2019, 365
    Posts
    3

    Re: Need Solution on Creating Running/Sequence Number Based on Value

    Quote Originally Posted by Fluff13 View Post
    How about in J3 on the Database sheet
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Hi Fluff, your solution works extremely well and it solved my problem as well, thanks a ton!
    I think I’ll close this thread as the problem is already solved, thank you guys for the help!

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,789

    Re: Need Solution on Creating Running/Sequence Number Based on Value

    Glad to help & thanks for the feedback.

+ 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. Replies: 3
    Last Post: 07-30-2019, 12:21 PM
  2. Replies: 9
    Last Post: 07-19-2017, 06:05 AM
  3. Creating an ascending number sequence in groups of 6
    By chakotay in forum Excel General
    Replies: 11
    Last Post: 10-03-2016, 01:37 PM
  4. Replies: 1
    Last Post: 11-07-2014, 12:10 AM
  5. [SOLVED] Creating Unique Number Sequence
    By CCSLBuckles in forum Excel General
    Replies: 3
    Last Post: 10-12-2014, 12:16 AM
  6. Creating Number Sequence in Groups of 10
    By DBWalsh12 in forum Excel General
    Replies: 8
    Last Post: 02-21-2013, 05:55 PM
  7. [SOLVED] Creating a sequence based on numbers in one column and adding "01,02..." to a new sequence
    By JCR1968 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-05-2013, 08:06 AM

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