+ Reply to Thread
Results 1 to 9 of 9

VLOOKUP with Multiple References

Hybrid View

  1. #1
    Registered User
    Join Date
    12-06-2008
    Location
    Syracuse
    Posts
    64

    VLOOKUP with Multiple References

    Hello,

    I am trying to accomplish a task that uses the VLOOKUP function to retrieve data from another worksheet. The problem I am having is that it will only return one row of data.

    In the formula below, there are multiple rows that contain the $C$4 reference.
    I would love to figure out how to return all the rows that contain that
    C$4$ reference. I hope this makes sense...??? Thanks!

    =VLOOKUP($C$4,'Hot Zone Customers'!$C$2:T561,14,0)
    Last edited by mbrady1973; 12-07-2008 at 10:07 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try this formula:

    =IF(ROWS($A$1:$A1)>COUNTIF('Hot Zone Customers'!$C$2:$C$561,$C$4),"",INDEX('Hot Zone Customers'!$C$2:$T$561,SMALL(IF('Hot Zone Customers'!$C$2:$C$561=$C$4,ROW('Hot Zone Customers'!$C$2:$C$561)-ROW('Hot Zone Customers'!$C$2)+1),14),ROWS($A$1:$A1)))
    After you enter it, hold the CTRL+SHIFT keys down and then Hit ENTER... You will see { } brackets appear around the formula.

    Then copy the formula down the column to retrieve multiple matches.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    12-06-2008
    Location
    Syracuse
    Posts
    64

    Thanks for the quick response

    I am receiving a #num! error....do you have any ideas?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Did you follow this instruction?

    After you enter it, hold the CTRL+SHIFT keys down and then Hit ENTER... You will see { } brackets appear around the formula.

  5. #5
    Registered User
    Join Date
    12-06-2008
    Location
    Syracuse
    Posts
    64

    Thanks Again

    OK...I hate to be "thick", but it is counting the instanes of the occurrence, yet it is not returning any actual values. What it is doing is placing a #Num! error in the cell. For example, if there is 4 instaces of '12345' as my reference, it is teturning 4 instances of #NUM!.

    Any idea what I might be doing wrong?

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Yes, you are correct.. I screwed up... I didn't have a sample to check against...I misplaced some parts of the Index function...

    try this instead:

    =IF(ROWS($A$1:$A1)>COUNTIF('Hot Zone Customers'!$C$2:$C$561,$C$4),"",INDEX('Hot Zone Customers'!$C$2:$T$561,SMALL(IF('Hot Zone Customers'!$C$2:$C$561=$C$4,ROW('Hot Zone Customers'!$C$2:$C$561)-ROW('Hot Zone Customers'!$C$2)+1),ROWS($A$1:$A1)),14))

  7. #7
    Registered User
    Join Date
    12-06-2008
    Location
    Syracuse
    Posts
    64

    Awesome!!!!!!!

    THANK a Bunch!!!!

    What part of that formula do I need to change to return the contents of the neighboring cell(s)? I don't have the mental capacity to figure that out...

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try ether:

    =IF(ROWS($A$1:$A1)>COUNTIF('Hot Zone Customers'!$C$2:$C$561,$C$4),"",INDEX('Hot Zone Customers'!$C$2:$T$561,SMALL(IF('Hot Zone Customers'!$C$2:$C$561=$C$4,ROW('Hot Zone Customers'!$C$2:$C$561)-ROW('Hot Zone Customers'!$C$2)+1),ROWS($A$1:$A1)),COLUMN(R$1)))
    or

    =IF(ROWS($A$1:$A1)>COUNTIF('Hot Zone Customers'!$C$2:$C$561,$C$4),"",INDEX('Hot Zone Customers'!P$2:P$561,SMALL(IF('Hot Zone Customers'!$C$2:$C$561=$C$4,ROW('Hot Zone Customers'!$C$2:$C$561)-ROW('Hot Zone Customers'!$C$2)+1),ROWS($A$1:$A1))))

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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