+ Reply to Thread
Results 1 to 12 of 12

Looking up one value then returning multiple matches across a row

  1. #1
    Registered User
    Join Date
    06-26-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    15

    Looking up one value then returning multiple matches across a row

    I have a workbook with two worksheets

    Sheet1 column C contains a list of names
    Sheet1 column D contains a list of alphanumberic values

    I have the below formula in another worksheet which is reading in a value from cell B3, looking this up in Sheet1 column D and returning the value from Sheet1 column C. I want to return all returned values across the row, eg. cell E3, E4, E5, etc. This works fine in the first cell containing the formula. I then copied it across horizontally and get a !NUM error in all the other cells.

    =INDEX(Sheet1!$C$2:$C$5000, SMALL(IF($B$3=Sheet1!$D$2:$D$5000, ROW(Sheet1!$D$2:$D$5000)-MIN(ROW(Sheet1!$D$2:$D$5000))+1, ""), COLUMN(B1)))

    Can somebody please tell me where I'm going wrong?

    Thanks,

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Looking up one value then returning multiple matches across a row

    Do you confrm this formula with C+S+E?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    06-26-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Looking up one value then returning multiple matches across a row

    I have tried both C+S+E which gives a !value error, and just hitting Enter gives me a data match, but then doesn't work for any other cells. Perhaps there is another issue with the formula because I don't fully understand it, i just copied and modified it from various other posts I found. Thanks.

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Looking up one value then returning multiple matches across a row

    =INDEX(Sheet1!$C$2:$C$5000, SMALL(IF($B$3=Sheet1!$D$2:$D$5000, ROW(Sheet1!$D$2:$D$5000)-MIN(ROW(Sheet1!$D$2:$D$5000))+1, ""), COLUMN(B1)))

    Try without absolute refernce in B3. $B3

  5. #5
    Registered User
    Join Date
    06-26-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Looking up one value then returning multiple matches across a row

    I've tried that too and still the same output

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Looking up one value then returning multiple matches across a row

    No idea...

    Maybe if you upload a sample workbook.

  7. #7
    Registered User
    Join Date
    06-26-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Looking up one value then returning multiple matches across a row

    I can't see an option to upload a spreadsheet, so here is the structure

    Sheet1
    ROLE NAME (C1) PERMISSION ID (D1)
    Name1 3
    Name2 3
    Name3 3
    Name4 3
    Ross1 4
    Ross2 4
    Matt 5
    Steve 6
    Phil 7
    Lucy 8

    Then on another sheet I have column B containing values 3, 4, 5, etc. Then column containing the above formula and copied across each row, and also down each column.

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Looking up one value then returning multiple matches across a row

    ....I can't see an option to upload a spreadsheet, so here is the structure..
    Oooo,You forgot it!! Same way like you did it, in this thread

    http://www.excelforum.com/excel-gene...92#post2838892

  9. #9
    Registered User
    Join Date
    06-26-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Looking up one value then returning multiple matches across a row

    Haha, but the paperclip icon from last time has disappeared??

  10. #10
    Registered User
    Join Date
    06-26-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Looking up one value then returning multiple matches across a row

    Ok I've found it now, see attached.
    Attached Files Attached Files

  11. #11
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Looking up one value then returning multiple matches across a row

    Sorry but i am not able to understand what are you trying to do....

  12. #12
    Registered User
    Join Date
    06-26-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Looking up one value then returning multiple matches across a row

    Ok sorry, I'll try to explain better...

    I have some ID numbers in column B in the Names worksheet.
    In a separate worksheet (ROLE_PERMISSION) I have a list of names with ID numbers.
    I want to be able to look up each ID number from the first worksheet and return a list of the names which have that ID (one name per cell across columns D, E, F, G). Does that help? I realise my cell references in the formula attached are slightly wrong but fixing these still gives the #NUM! error.... Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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