+ Reply to Thread
Results 1 to 11 of 11

Lookup a Value and Return Multiple Results

  1. #1
    Registered User
    Join Date
    03-05-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Lookup a Value and Return Multiple Results

    Hi all,

    Help please !!

    I have been using this formula to do lookup and return values
    "=INDEX(ResultsColumn,SMALL(INDEX((CriteriaColumn=Criteria)*(ROW(CriteriaColumn)-ROW(FirstCellOfCriteriaColumn)+1),),COUNTIF(CriteriaColumn,"<>"&Criteria)+ROWS(A$1:A1)))"

    I have come across a little problem and needing a little help on a solution.

    i'm using this formula in a roster scene to pick up people that call in sick and display their rostered job in a different cell.
    the problem that i am having say for example employee one calls in sick at 2 pm and i assign that job in a corresponding cell to another,
    then employee 2 calls in sick for the 1pm shift (the call was made after i have already rostered employee one a replacement), the formula automatically places the 1 pm in the cell above the 2pm.
    is there a way to stop it from changing the value once a value is entered in a corresponding cell?

    I would like to thank Member "tigeravatar" for providing the formula totarial in the first place below is the link to the original formula thread.
    http://www.excelforum.com/tips-and-t...e-results.html

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup a Value and Return Multiple Results

    Can you post a SMALL sample file that shows us what you have and what you want?

    A SMALL file will have about 20 rows worth of data.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    03-05-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Lookup a Value and Return Multiple Results

    Hi Tony, Thank you for looking at my issue.

    Below is a little extract of the file.
    As you can seen I have already placed 2 S/L in the left section of the file. The formula has transferred the required data to the right hand side.
    In the file if I assign a name to cover job "342" then afterwards job "309" calls in sick. On the right hand side under "sick leave duties to cover" 309 is automatically placed on top of 342 and 113. So the assigned name to cover 342 is now pointing at 309.

    I'm just looking at a way to stop that if possible.
    Attached Files Attached Files

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup a Value and Return Multiple Results

    I'm not sure I follow you on this.

    Are you wanting to make the list in chronological order?

  5. #5
    Registered User
    Join Date
    03-05-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Lookup a Value and Return Multiple Results

    As you can see the duty number in the sick leave column are in order from the spreadsheet. So if a duty calls in sick from above (earlier start time, as it is sorted by that), the duty on the right hand side is placed above the previously placed duty.
    I don't know if I am explaining it right. But if you type "s/l" in the "code" section and above the ones that are already marked, u'll see that the duty you type in will be placed above that in tje right hand side " sick leave section".

    Maybe there is a code I can put in to check the "j" column and if it has any value in it then wont change vale if an earlier duty calls in sick.

    thank you for your help.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup a Value and Return Multiple Results

    Sorry, still confused!

    In the sample file...

    I entered S/L in cell C22 (Duty 308).

    Now we have:

    Data Range
    I
    J
    K
    26
    308
    ------
    8:10
    27
    342
    9:10
    28
    113
    9:25


    What do you want it to display?

  7. #7
    Registered User
    Join Date
    03-05-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Lookup a Value and Return Multiple Results

    See how duty 308 is on top of 342 and 113. Had I already assigned a driver to cover 342 in column j row 26 before 308 called in sick. It will now show the assigned name in j26 to be covering 308 instead of 342.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup a Value and Return Multiple Results

    Ok, now I see what's happening.

    Hmmm...

    That's a tricky one. I'll have to think about this for a while.

    I'll get back to you!

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup a Value and Return Multiple Results

    Ok, a few options...

    1. Use an event macro to generate the summary list. Whenever you enter S/L in the code column then the macro will automatically add the corresponding info to the summary list. This method eliminates the need for any formulas.

    2. Use an event macro to add a time stamp on the left side data area whenever you enter S/L in the code column. Then you can use a formula to generate the summary list based on chronological order.

    3. Enter the replacement name on the left side data area. Then, the formula will bring the corresponding replacement name to the summary area.

    I'm not much of programmer so you'll need someone else to help you with 1 and 2.

  10. #10
    Registered User
    Join Date
    03-05-2014
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Lookup a Value and Return Multiple Results

    Thank you for your help Tony.

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup a Value and Return Multiple Results

    You're welcome!

+ 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. Lookup a Value and Return Multiple Results
    By tigeravatar in forum Tips and Tutorials
    Replies: 13
    Last Post: 04-08-2016, 04:44 PM
  2. [SOLVED] Name Variable LOOKUP to return multiple results
    By mmayna03 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-03-2012, 01:59 PM
  3. Lookup & return Multiple Results
    By benishiryo in forum Excel Tips
    Replies: 2
    Last Post: 07-11-2012, 10:11 AM
  4. lookup 2 values and return multiple results
    By humboldtguy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-17-2010, 09:49 PM
  5. Return Multiple Results with Lookup
    By Josh O. in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-04-2005, 05:06 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