+ Reply to Thread
Results 1 to 6 of 6

sequence number based on date

  1. #1
    denise
    Guest

    sequence number based on date

    Hi folks,

    I'm trying to set up an auto sequence number(col A) based on a date entry
    (col B) as in the example below. The sequence number should reset to 0001
    each time the date in Col B changes. Is this possible?

    Col A Col B
    072306-0001 07/23/06
    072306-0002 07/23/06
    072306-0003 07/23/06
    072406-0001 07/24/06

    Thanks,
    Denise

  2. #2
    Ron Coderre
    Guest

    RE: sequence number based on date

    Try something like this:

    For a list of dates, beginning in B2

    A2: =TEXT(B2,"mmddyy")&"-"&TEXT(COUNTIF($B$2:B2,B2),"0000")
    Copy that formula down as far as you need.

    Or....to avoid errors for blank cells.
    A2: =IF(ISBLANK(B2),"",TEXT(B2,"mmddyy")&"-"&TEXT(COUNTIF($B$2:B2,B2),"0000"))


    Is that something you can work with?
    ***********
    Regards,
    Ron

    XL2002, WinXP


    "denise" wrote:

    > Hi folks,
    >
    > I'm trying to set up an auto sequence number(col A) based on a date entry
    > (col B) as in the example below. The sequence number should reset to 0001
    > each time the date in Col B changes. Is this possible?
    >
    > Col A Col B
    > 072306-0001 07/23/06
    > 072306-0002 07/23/06
    > 072306-0003 07/23/06
    > 072406-0001 07/24/06
    >
    > Thanks,
    > Denise


  3. #3
    denise
    Guest

    RE: sequence number based on date

    Ron, this works great! Thanks much!

    - Denise

    "Ron Coderre" wrote:

    > Try something like this:
    >
    > For a list of dates, beginning in B2
    >
    > A2: =TEXT(B2,"mmddyy")&"-"&TEXT(COUNTIF($B$2:B2,B2),"0000")
    > Copy that formula down as far as you need.
    >
    > Or....to avoid errors for blank cells.
    > A2: =IF(ISBLANK(B2),"",TEXT(B2,"mmddyy")&"-"&TEXT(COUNTIF($B$2:B2,B2),"0000"))
    >
    >
    > Is that something you can work with?
    > ***********
    > Regards,
    > Ron
    >
    > XL2002, WinXP
    >
    >
    > "denise" wrote:
    >
    > > Hi folks,
    > >
    > > I'm trying to set up an auto sequence number(col A) based on a date entry
    > > (col B) as in the example below. The sequence number should reset to 0001
    > > each time the date in Col B changes. Is this possible?
    > >
    > > Col A Col B
    > > 072306-0001 07/23/06
    > > 072306-0002 07/23/06
    > > 072306-0003 07/23/06
    > > 072406-0001 07/24/06
    > >
    > > Thanks,
    > > Denise


  4. #4
    Registered User
    Join Date
    02-18-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: sequence number based on date

    Hi, I used the formula above for my worksheet, and it worked great until I realised that the sequential numbers are reassigned whenever I sort the content of my table by different columns. The numbers should be unique numbers, they shouldn't change when the order of item changes. Any idea how I can fix this? Thanks so much for your help!
    Barbara

  5. #5
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: sequence number based on date

    Barbara,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  6. #6
    Registered User
    Join Date
    02-18-2014
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: sequence number based on date

    ok, no problem. Will do, thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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