+ Reply to Thread
Results 1 to 9 of 9

Sequential Numbering of Unique Entries

  1. #1
    Registered User
    Join Date
    09-23-2013
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Sequential Numbering of Unique Entries

    Hi All,

    A little background, I have an event management doc that lists all of the information about events during the year (name, time, place, lead counts, cost, etc). I would like to use this document to create a dynamic calendar that populates some information about each event in the appropriate date box (I might need some help on that later). To do this, my current thought is to assign each event a unique id (based primarily on the date) so that I can match it up to a date in the calendar. This is a living document that is always being updated and added to, so id might change as more info is added.

    Here is my hold up: I would like to assign a sequential count to each event on a given day, in a given county, by time. So that Event "AA" on 01/01, in LA would have an id of 1, and "AB" on 01/01 in LA would have an id of 2; "AD" on 01/01 in OC would have an id of 1.

    In essence, the sequence restarts everyday, for each county and is ranked by time (then by key if time is the same).

    (If there is an easier way to do this (or the calendar thing) please let me know...)

    Thanks for the help!!

    Art
    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,193

    Re: Sequential Numbering of Unique Entries

    Data sorted by:

    County
    Date
    Time
    Key

    ID in Column G

    =COUNTIFS($B$2:$B2,$B2,$C$2:$C2,$C2)

    I would suggest you change the "TIMES" to Excel time format (hh:mm) rather just a simple number.

    See the following as an example of a Calendar workbook:

    http://www.excelforum.com/excel-form...-2-tables.html

    Thanks to Pete_UK for the above
    Attached Files Attached Files
    Last edited by JohnTopley; 08-03-2016 at 01:01 AM.

  3. #3
    Registered User
    Join Date
    09-23-2013
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Sequential Numbering of Unique Entries

    Hi John,

    Thanks for the help.

    So I think your solution only works when the table is sorted correctly. however, because this doc is used by a lot of people, it is often sorted by a completely different column. Ideally what I am looking for will work regardless of how the table is sorted.


    Second, thank you for the other thread. The last file there is very close to what I am going for. However, for the calendar I will need to be able to select between counties, so that each county has its own calendar. Also, I have been trying to replicate that formula in my table (rank([@date],[date]...countif..) but it's not working correctly. I guess what I need then is a unique rank (by time) of all events in the same county on the same day.

    Hope this makes sense.

    Thank you again!!
    Art

  4. #4
    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,193

    Re: Sequential Numbering of Unique Entries

    I am not sure to can get the ID you want without sorting: to do this means a "continuous" search to find the next date/time combination for a given location.

    Is it possible to get an ID which is a concatenation of Location/Date/time?

  5. #5
    Registered User
    Join Date
    09-23-2013
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Sequential Numbering of Unique Entries

    I have seen some people use a sumproduct with rank.. not sure if that can work (I haven't been able to figure it out).
    http://www.ozgrid.com/forum/showthread.php?t=141020
    (and again, I am using table references, so that may be a problem too)

    So the problem with adding the time is that the calendar will not have a time reference. I will be using a concatenation of "DATE_LOCATION_ID" to match an event with a date and the row (within a given date box) on which to pull Event name. This is why I would like the rank to be in time" order so that the events are displayed chronologically on the calendar.

  6. #6
    Registered User
    Join Date
    09-23-2013
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Sequential Numbering of Unique Entries

    So this is almost getting there..
    =1+SUMPRODUCT(([County]=[@County])*([Date]=[@Date])*([Time]<[@Time]))

    It ranks counties and dates individually, but entries with the same time are not uniquely ranked by the "key".

    Here is what I get:
    Key County Date Time CalID
    5 LA 01/03/2016 7:00 1
    6 LA 01/03/2016 13:00 3
    7 LA 01/03/2016 14:00 5
    8 LA 01/03/2016 7:00 1
    9 LA 01/03/2016 13:00 3

    The calID should read (going down): 1,3,5,2,4

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,556

    Re: Sequential Numbering of Unique Entries

    This solution makes use of a helper column (E) which could be hidden for aesthetic purposes. The formula for the helper column is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The formula for the ID then becomes:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Notice: that two of the formula generated results differ from the expected results for the reasons given in the attached file.
    Let me know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  8. #8
    Registered User
    Join Date
    09-23-2013
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Sequential Numbering of Unique Entries

    Thanks Jete! I actually did something very similar to this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    As far as I can tell, this is working.

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,556

    Re: Sequential Numbering of Unique Entries

    Glad that you found a solution that works and thank you for the feedback. Please take a moment to mark the thread 'Solved' using the thread tools link above your first post. I hope that you have a blessed day.

+ 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] Non-sequential row numbering
    By joelh327 in forum Excel General
    Replies: 5
    Last Post: 01-27-2016, 01:04 AM
  2. Macro For Unique Sequential Numbering on multiple sheets
    By dkannapel in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-03-2014, 02:57 PM
  3. Sequential Numbering and Unique Reference Codes
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-17-2014, 08:35 AM
  4. Numbering unique entries
    By zarnee in forum Excel General
    Replies: 7
    Last Post: 01-23-2010, 02:17 PM
  5. Sequential numbering
    By mojura in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-17-2009, 01:52 PM
  6. Sequential Numbering
    By Mel in forum Excel General
    Replies: 10
    Last Post: 05-09-2006, 10:15 AM
  7. Sequential numbering
    By REELAXER in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 12:05 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