+ Reply to Thread
Results 1 to 6 of 6

Priority Based Lookup

  1. #1
    Registered User
    Join Date
    12-13-2010
    Location
    melbourne australia
    MS-Off Ver
    Excel 2016
    Posts
    58

    Priority Based Lookup

    Hi,

    Just wondering if someone can help me with the attached file.

    What i have on the sheet are 3 removal dates with 3 removal reasons. I need to bring across the date and reason based on the priority table on my right of the sheet.

    for example the first row has a 1st removal reason of Blue drive, second removal reason of purple drive and third removal reason of orange drive. Based on the priority table i need the first reason to have a priority of "1" to show itself in the highlighted row along with the date.

    Hope this makes sense.

    Thank you

    Viren
    Attached Files Attached Files

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Priority Based Lookup

    Hi Viren- paste this in I2 and copy down:
    Please Login or Register  to view this content.
    ...and this in H2, copied down:
    Please Login or Register  to view this content.
    Last edited by leelnich; 02-18-2018 at 09:52 AM.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,915

    Re: Priority Based Lookup

    Try this in H2 **:

    =INDEX(A2:E2,MATCH(INDEX($O$15:$O$21,MATCH(MIN(IF(COUNTIF(B2:F2,"*"&$O$15:$O$21&"*"),$P$15:$P$21)),
    IF(COUNTIF(B2:F2,"*"&$O$15:$O$21&"*"),$P$15:$P$21),0))&"*",B2:F2,0))

    Array formula, enter with Ctrl+Shift+Enter.

    in I2:

    =INDEX(B2:F2,MATCH(H2,A2:E2,0))

  4. #4
    Registered User
    Join Date
    12-13-2010
    Location
    melbourne australia
    MS-Off Ver
    Excel 2016
    Posts
    58

    Re: Priority Based Lookup

    Thanks for you help leelnich and Phuocam.

    Works perfectly.

    Cheers
    Viren

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Priority Based Lookup

    My proposal in post#2 has 2 problems. 1) It errors if no priority 1 is available. Wrap it in an IFERROR statement to control output in that case. 2) It returns the first high-priority instance by position, which only coincides with the earliest date if the row is sorted earliest-latest (as most are). The following approach avoids both issues, returning the earliest DATE applying to the highest AVAILABLE priority.
    In H2, copied down:
    Please Login or Register  to view this content.
    ...and in I2, copied down:
    Please Login or Register  to view this content.

  6. #6
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Priority Based Lookup

    You're most welcome! If concluded, please mark your thread as SOLVED (Thread Tools above post #1). Regards - Lee
    Last edited by leelnich; 02-18-2018 at 08:47 PM.

+ 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] Set a priority based on a date
    By mlennox2701 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-14-2017, 04:29 AM
  2. Replies: 2
    Last Post: 05-10-2017, 07:32 PM
  3. Format Row Based on Priority
    By markusvirus in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-28-2017, 05:50 AM
  4. [SOLVED] Calculating Date Based on Priority
    By MrPifster in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-16-2017, 05:38 PM
  5. [SOLVED] Priority setting based on five conditions
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2016, 10:40 AM
  6. Result based on existance & priority
    By anetsurfer in forum Excel General
    Replies: 4
    Last Post: 12-05-2009, 02:20 AM

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