+ Reply to Thread
Results 1 to 8 of 8

Need a Formula to give a group a unique number

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-30-2008
    Location
    PSL, FL
    Posts
    271

    Need a Formula to give a group a unique number

    Hello everybody,

    I have been tasked at my Police Department with tracking ticket books. Each ticket book is unique and assigned to an indivudual officer.

    What I need to do is dig through 6 years of excel data over 25k tickets and assign each book a unique number. I have a file with no personal data just ticket numbers and am hoping someone could help me with a formula to give every ticket book its unique number. I will explain the numbering system below

    Tickets are numbered the following way

    1234-ABC

    each book contains 25 tickets. so its starts as follows

    xx01-ABC through xx25-ABC then the next book in that series is xx26-ABC through xx50-ABC and so on and so on.

    below I will post a small sample of the rows I did myself by hand. I have also attached the file if anybody would like to take a stab at this. as long as you keep the ID I can match it back to the original data.

    Thanks a million,

    Matt

    HTML Code: 
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Need a Formula to give a group a unique number

    Try at D5:

    =D4+IF(C5<>C4,1,IF(INT((B5-1)/25)=INT((B4-1)/25),0,1))

    copied down
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    06-30-2008
    Location
    PSL, FL
    Posts
    271

    Re: Need a Formula to give a group a unique number

    Quote Originally Posted by NBVC View Post
    Try at D5:

    =D4+IF(C5<>C4,1,IF(INT((B5-1)/25)=INT((B4-1)/25),0,1))

    copied down
    Can seem to make this work just shows 1's

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Need a Formula to give a group a unique number

    See attached
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    06-30-2008
    Location
    PSL, FL
    Posts
    271

    Re: Need a Formula to give a group a unique number

    Quote Originally Posted by NBVC View Post
    See attached
    WOW thanks

    Almost perfect

    it screwed up on row

    B10075 because I had a ' in the number I removed that and it worked but the cells below didnt work? what do I need to do to make them recalculate?

    Matt

  6. #6
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,651

    Re: Need a Formula to give a group a unique number

    Try this in any cell in row 2 for new ID:
    =TEXT(ROW()-1,"0000")&"-ABC"
    Copy down.
    Does it work?
    Quang PT

  7. #7
    Forum Contributor
    Join Date
    06-30-2008
    Location
    PSL, FL
    Posts
    271

    Re: Need a Formula to give a group a unique number

    Quote Originally Posted by bebo021999 View Post
    Try this in any cell in row 2 for new ID:
    =TEXT(ROW()-1,"0000")&"-ABC"
    Copy down.
    Does it work?
    I probably confused you.

    The ticket range must stay the same I just used ABC to show it was Letters.

    The unique book number can be anything as simple as 1,2,3,4,....

    I am just trying to make it easy to say let me see all the tickets from book 4
    and who it was assigned to. I can do all that from my main spreadsheet

    I just need to give a unique book number.

    Matt

  8. #8
    Forum Contributor
    Join Date
    06-30-2008
    Location
    PSL, FL
    Posts
    271

    Re: Need a Formula to give a group a unique number

    nevermind got it can you mark this as SOLVED!

    Thanks

    Matt

+ 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