+ Reply to Thread
Results 1 to 8 of 8

Assign unique ID to sorted, unique dates

Hybrid View

  1. #1
    Registered User
    Join Date
    03-21-2018
    Location
    Utrecht
    MS-Off Ver
    Microsoft Professional Plus 2013
    Posts
    4

    Lightbulb Assign unique ID to sorted, unique dates

    Hello everyone,

    Could you help me out? For my work I use a task-decision list in which I have to manually assing unique ID's (numerical values) to every meeting and every task. So let's say I had a meeting with company A on 1-1-2018 that resulted in 4 tasks; the 'meeting-ID' for each of those 4 tasks will be a '1'.

    Functional: I would like to automate the generation of this ID.
    Technical: I want the formula to do two things: 1) define unique dates per company, 2) assign a numerical value to those dates based on the chronological sequence.

    I've included an attachment that shows and describes the problem in a bit more detail. Hope to hear/learn from you guys.
    Attached Files Attached Files
    Last edited by Pigeras; 03-21-2018 at 12:26 PM.

  2. #2
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Assign unique ID to sorted, unique dates

    Select all and then on the data tab do the sort you wish.

  3. #3
    Registered User
    Join Date
    03-21-2018
    Location
    Utrecht
    MS-Off Ver
    Microsoft Professional Plus 2013
    Posts
    4

    Re: Assign unique ID to sorted, unique dates

    As I mentioned, I would like to have it automated in a function/formula. So the formula has to automatically assign a unique ID based on the date + company (so 2 variables) AND sort the dates (so the numerical ID's correspond with the sorted data).

  4. #4
    Banned User!
    Join Date
    09-26-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    607

    Re: Assign unique ID to sorted, unique dates

    They will stay together if you add more criteria for the sort.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Assign unique ID to sorted, unique dates

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  6. #6
    Registered User
    Join Date
    03-21-2018
    Location
    Utrecht
    MS-Off Ver
    Microsoft Professional Plus 2013
    Posts
    4

    Re: Assign unique ID to sorted, unique dates

    Quote Originally Posted by Glenn Kennedy View Post
    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Thanks for the tip, Glenn! I've included an attachment with additional problem description.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Assign unique ID to sorted, unique dates

    Hi. My head started to fry when I read this. I've made what I think is an intelligent guess. But I'm not sure as there were too many words and not enough examples of what was right and what was wrong. I added an extra column, with a number. This locks the rest of it together.

    Then in D2:

    =SUMPRODUCT((C2 > C$2:C$12)*($B$2:$B$12=B2)/COUNTIFS(C$2:C$12,C$2:C$12,$B$2:$B$12,$B$2:$B$12))+1+[@Column2]/10^10

    and in A2:

    =IF([@date]="","",UPPER(LEFT(E2,1))&"-"&[company]&"-"&TEXT([@Column1],"0")&"-"&COUNTIFS($C$1:$C2,$C2,$E$1:$E2,$E2))
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-21-2018
    Location
    Utrecht
    MS-Off Ver
    Microsoft Professional Plus 2013
    Posts
    4

    Re: Assign unique ID to sorted, unique dates

    Thanks for your response, Glenn! I've adjusted the problem description, both here and in the attachment. Regarding your input, although it works, the primary reason for my query is to avoid adding another column or manually inserting numbers. I was hoping to automate that part.

+ 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] Sorted and unique validation list
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-23-2016, 05:20 PM
  2. [SOLVED] Get unique sorted combobox on userfrom
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-19-2015, 06:06 AM
  3. [SOLVED] Get unique values sorted
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-01-2015, 08:40 AM
  4. Assign unique ID IF adjacent cell has unique value
    By attaboy000 in forum Excel General
    Replies: 1
    Last Post: 06-05-2014, 02:17 PM
  5. # of unique dates per unique list entry
    By MrNovice in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-27-2009, 07:01 AM
  6. Sorted List of all Unique strings
    By ElmerS in forum Excel General
    Replies: 2
    Last Post: 04-30-2009, 02:40 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