+ Reply to Thread
Results 1 to 5 of 5

hlookup under merged cells

  1. #1
    Registered User
    Join Date
    06-13-2007
    MS-Off Ver
    Office 365 (Version 2306)
    Posts
    72

    hlookup under merged cells

    I have cells in Row 4 merged in pairs. That is, N4:O4 are merged into 1 cell, P4:Q4 are merged into 1 cell, R4:S4 are merged into 1 cell, etc, and there are 55 such pairs up to DR4:DS4.

    Cells in Row 7 are not merged in pairs.

    I would like some way of doing a HLOOKUP across the 55 merged cells in Row 4 and return both values in the corresponding cells in Row 7 underneath the matching cell Row 4.

    I hope this makes sense.

    I am using Excel 2007 and will need idiot proof instructions about how to implement a VBA solution if this is the only possible way of doing what I need.

    Thanks in advance for your consideration of my question. The other teachers and secretaries at my school will never know how much of a help you will have been!
    Regards,

    David Obeid

    http://david.obeid.googlepages.com

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: hlookup under merged cells

    I'm strongly opposed to merging cells, and expect you could (and should) use Center across selection instead.

    That said, the HLOOKUP will work, provided you're looking for an exact match in the top row, and retrieving the value of the cell below the left cell in the merged pair.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    06-13-2007
    MS-Off Ver
    Office 365 (Version 2306)
    Posts
    72

    Re: hlookup under merged cells

    I'll have a play with Centre Across Selection, but in the mean time, I need both left and right cells. (I got the left cell, but can't get the right).

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: hlookup under merged cells

    use index match to match a1
    ist number
    =INDEX(N4:DS7,4,MATCH(A1,N4:DS4,0))
    second number
    =INDEX(N4:DS7,4,MATCH(A1,N4:DS4,0)+1)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    06-13-2007
    MS-Off Ver
    Office 365 (Version 2306)
    Posts
    72

    Re: hlookup under merged cells

    Thankyou

+ 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