+ Reply to Thread
Results 1 to 8 of 8

VLOOKUP for merged cells

  1. #1
    Registered User
    Join Date
    05-23-2006
    Posts
    58

    Exclamation VLOOKUP for merged cells

    Here's my VLOOKUP problem:

    The column that my VLOOKUP formula is finding the lookup_value in contains merged cells. When I ask for a value from a col_index_num that doesn't contain merged cells, the formula returns only the first value. How can I get the formula to return all of the corresponding values?

    For example, lets say my lookup_value can be found in A2 where A2 is actually A2:A4 merged. I want values returned from column B which are not merged. The returned value is from B2, but I want B2, B3, and B4 returned because those are the three cells that correspond to the merged A2.

    Any help is appreciated.
    Last edited by Spreadsheet; 05-11-2007 at 01:55 PM.

  2. #2
    Registered User
    Join Date
    09-03-2003
    Location
    UK
    Posts
    95
    VLOOKUP() will onlyreturn the first value it finds that matches. Why not use SUMIF() instead?

  3. #3
    Registered User
    Join Date
    05-23-2006
    Posts
    58

    sumif won't work

    My values are not numeric. I want to be able to return each of the three corresponding values. What I do with them after I have them is a trivial problem. Any ideas anybody? Thanks.

  4. #4
    Registered User
    Join Date
    01-15-2007
    Posts
    28

    First Merged Cell

    When you clicked on the merged cells your formula return a range of cells. For example, =vlookup(A2:B6,table1,2,0), the lookup range of vlookup is the merged cells of A2:B6.

    Excel will return a #VALUE statement in this instance. To correct the problem have the look up cell only be A2 or the first cell in your merged cells.

    Therefore the new example would like =vlookup(A2,table1,2,0) and that will give you a your looked up value from table1.

  5. #5
    Registered User
    Join Date
    05-23-2006
    Posts
    58

    Exclamation That's not the problem

    Thanos, I was already using a formula similar to your example. That's not the problem. Does anybody out there know what to do about this issue?

    My lookup value for a VLOOKUP formula will be found in a cell that is merged (let's say 3 cells for example). I want to know how I can choose which of the three corresponding values from the col_index_num the formula will return.

    Any help would be appreciated.

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

    =INDEX($B$2:$B$100,MATCH($X$1,$A$2:$A$100,0)+ROW($A1)-1)

    Where A2:B100 contains the table and the value to lookup is in X1.

    copy the formula down necessary number of rows to get all info
    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.

  7. #7
    Registered User
    Join Date
    05-24-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    34

    Re: VLOOKUP for merged cells

    I have same problem but I dont understand what is X1 value?

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: VLOOKUP for merged cells

    Welcome to the Forum, aidda

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

    the value to lookup is in X1.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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