+ Reply to Thread
Results 1 to 5 of 5

VLookup Query

  1. #1
    Registered User
    Join Date
    06-01-2011
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    8

    VLookup Query

    Afternoon all,

    I am trying to use vlookup to return two rows in the attached example. Basically when I select Area A and Team 1 in the Selection I want to return the two rows answers (Alice, Chris), in two separate cells (D11 & D12). At the moment I am only able to return the first row answer (Alice)

    This is a simplified example of something bigger I want to use it for. If anyone can tell me how to do this or suggest another way of returning these two values, in two separate cells that would be great

    Thanks

    senan_g
    Attached Files Attached Files
    Last edited by senan_g; 10-18-2011 at 11:48 AM.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: VLookup Query

    VLOOKUP only returns the first match in a range. There are ways to look up multiple values, but I can tell you now that they're going to be made hard by you using merged cells. Is there any possibility of getting rid of them?

  3. #3
    Registered User
    Join Date
    06-01-2011
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: VLookup Query

    Hi Andrew

    Yes there is some flexibility with the merged cells. I have laid it out in two different options in the updated attachment - would either of these ways work in terms of returning multiple rows.

    Tnx

    S
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: VLookup Query

    Option 2 works the best, and in your example I've put the following formula in cell D11 downwards ... =IF((ROW()-10)>COUNTIF($J$27:$J$32,$D$8),"",INDEX($K$27:$M$32,SMALL(IF($J$27:$J$32=$D$8,ROW($J$27:$J$32)-26),ROW()-10),MATCH("Team "&$D$9,$K$26:$M$26,0)))

    This must be entered as an array formula, so instead of simply pressing Enter to put the formula into the cell you have to use Ctrl-Shift-Enter

    Given the rather long nature of the formula you might be best of giving me an example which mirrors the final layout of your sheet so that I can adapt it for you.

  5. #5
    Registered User
    Join Date
    06-01-2011
    Location
    London, UK
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: VLookup Query

    Thanks Andrew

    Actually I took your first advice and went with eliminating the merged rows. So instead of Area A I know have Area A Member 1 and Area Member 2, which allows me use the vlookup function.

    Thanks for your advice - your approach was useful from a learning perspective anyway.

    Cheers

    senan_g

+ 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