+ Reply to Thread
Results 1 to 13 of 13

Indicate min priority of identical terminal in the same day

  1. #1
    Registered User
    Join Date
    09-22-2014
    Location
    Tehran
    MS-Off Ver
    2013
    Posts
    11

    Indicate min priority of identical terminal in the same day

    Hi,
    I have a dataset which has various terminal ids with different priority in different days.
    I need to indicate single terminals (without regard to priority value) in each day and the row of the lowest "priority" value in the duplicate terminal IDs.

    for example terminal Id: 102030

    102030 in 1-dec-2019 choose first one(due to low value of priority)

    102030 in 2-dec-2019 it is single in that day so choose itself.

    (as picture attached in "I need this" column)

    Thanks in advance
    Attached Images Attached Images
    Attached Files Attached Files

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

    Re: Indicate min priority of identical terminal in the same day

    You can use:

    =IF(C2=AGGREGATE(15,6,$C$2:$C$8/(($A$2:$A$8=A2)*($B$2:$B$8=B2)),1),"OK","Not OK")
    Attached Files Attached Files
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Indicate min priority of identical terminal in the same day

    this would be one way but it is using a helper column. Put this in column E or somewhere... {=MIN(IF(($A$2:$A$8=A2)*($B$2:$B$8=B2),$C$2:$C$8))}
    Note that is an array formula so past in to a cell this... =MIN(IF(($A$2:$A$8=A2)*($B$2:$B$8=B2),$C$2:$C$8)) then with your cursor in the formula bar hit ctrl + shift + enter all at the same time so these braces appear on each end {}, that means the formula is activated - YOU CANNOT add them. Then drag toward down.

    Next, put this formula in another column =IF(E2=C2,"ok","not ok")
    drag both down.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Indicate min priority of identical terminal in the same day

    Sigh, I kept waiting for someone to give the OP a better answer than that array with helper column, THANKS Glenn for providing it.

  5. #5
    Registered User
    Join Date
    09-22-2014
    Location
    Tehran
    MS-Off Ver
    2013
    Posts
    11

    Re: Indicate min priority of identical terminal in the same day

    Thank both,
    how could add another condition?
    for example the same terminal Id, the same day and the same priority? if I faced with something like that I need just one of them. dataset has hour column too, could we use that column to return "ok" the latest one??

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Indicate min priority of identical terminal in the same day

    you should update your attachment so additional columns and conditions can be accounted for.

  7. #7
    Registered User
    Join Date
    09-22-2014
    Location
    Tehran
    MS-Off Ver
    2013
    Posts
    11

    Re: Indicate min priority of identical terminal in the same day

    its updated
    Attached Files Attached Files

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Indicate min priority of identical terminal in the same day

    can you explain how you want the outcome this time? Does a later time but lower priority number take place over the earlier time with a higher priority? And you didn't include ties, how do you want ties handled?
    The way Glenn's formula is working is that it is pulling the lowest number based on the terminal ID and Date, it works because you have the same terminal ID and same Date more than once. If you add hour into it you now have distinct events again which defeats the formula. So applying what I believe is the logic Glenn used all come out as ok.
    you should add the outcomes you expect to your workbook.

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

    Re: Indicate min priority of identical terminal in the same day

    Yes. Your sample is incorrect. There are NO rows with same terminal/same date/same priority. So, udate it again. AND show your expected answers - if there are two priority 1s... which one is "OK and which one is "Not OK"... and WHY?

  10. #10
    Registered User
    Join Date
    09-22-2014
    Location
    Tehran
    MS-Off Ver
    2013
    Posts
    11

    Re: Indicate min priority of identical terminal in the same day

    Yes you right, its updated again.

    Just one terminal Id in each day is acceptable, if we have identical terminal Id in a day first preference is the terminal ID with the lower priority, and if we have identical terminal Id with the same priority in a day there is no any preference to choose, but we have to choose just one of them so I suggested to use of hour column.
    if we could handle that without hour column its ok.

    thanks a billion
    Attached Files Attached Files

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

    Re: Indicate min priority of identical terminal in the same day

    Check this one. I will see if I can find a cleaner way to do this.
    Attached Files Attached Files

  12. #12
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Indicate min priority of identical terminal in the same day

    This is not so simple. It returns as expected (shadowed in column F). It must be array entered in F2 and filled down.

    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    A non CSE version of this can be done but would be much longer. Will post if you prefer.
    Dave

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Indicate min priority of identical terminal in the same day

    BTW is your profile current?

    Office 365 (and maybe Office 2019?) have the MINIFS function that would make short work of this.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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] Identical Formulas from Identical Data Sets Return Different Results
    By EverClever in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-28-2018, 06:56 PM
  2. Replies: 2
    Last Post: 05-10-2017, 07:32 PM
  3. Adding Multiple Identical tables to a Master Identical table
    By dlogfx in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-24-2017, 04:41 PM
  4. [SOLVED] Identical Text not identical (for =, vlookup, etc) MAKING ME CRAZY
    By jnt in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-22-2015, 09:57 PM
  5. Replies: 10
    Last Post: 01-09-2015, 04:40 PM
  6. Replies: 4
    Last Post: 01-25-2012, 05:49 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