+ Reply to Thread
Results 1 to 9 of 9

Vlookup to pull FROM a merged cell

  1. #1
    Registered User
    Join Date
    05-07-2019
    Location
    Nashville, TN
    MS-Off Ver
    2016
    Posts
    10

    Vlookup to pull FROM a merged cell

    Hello,

    Every vlookup/merged cell post I see assumes the lookup value is the merged cell. In this case, the column index that I am pulling from is the merged cell, and that is causing the following problem:

    Cells A1 and A2 are two separate cells, but both are associated with merged cell B1:B2. However, when running a vlookup to find results for cell A2, it pulls back a "0" because it it associated with a merged cell.

    Let's say cell A1 is "Scrappy" and cell A2 is "Scooby" and then both are next to a merged cell B1:B2, which is "Doo". When running a vlookup for Scrappy and Scooby, the value next to "Scrappy" will pull back "Doo", but the value for "Scooby" will pull back a "0", even though both are next to the same merged cell.

    Can someone explain how to get "Doo" to populate next to "Scooby" instead of a "0" for the associated merged cell?

    Thank you!
    Attached Images Attached Images

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Vlookup to pull FROM a merged cell

    Are willing/able/allowed to unmerge B1:B2 and enter "Doo" into B2? That seems the simplest solution to me.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    05-07-2019
    Location
    Nashville, TN
    MS-Off Ver
    2016
    Posts
    10

    Re: Vlookup to pull FROM a merged cell

    We are trying to avoid that. The column has a large amount of data with said merged cells, so un-merging them all just to duplicate the data would be counter-productive in terms of time.

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Vlookup to pull FROM a merged cell

    Hi
    See if helps you. Try this approach
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Only works if merged cells have regularity.

  5. #5
    Registered User
    Join Date
    05-07-2019
    Location
    Nashville, TN
    MS-Off Ver
    2016
    Posts
    10

    Re: Vlookup to pull FROM a merged cell

    When you say "regularity", do you mean the values of all merged cells need to be the same? Because that is not the case here. I tried your formula, and it worked for the specific example I had, but not for the larger column issue.

  6. #6
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Vlookup to pull FROM a merged cell

    If your merged cell groupings are variable (e.g. 2 cells, 4 cells, 3 cells, 2 cells) finding a single formula to account for that will be very difficult. Unfortunately, there's nothing in Excel that detects whether a cell is merged, except VBA, so there's no way in an Excel formula to say "go to the first part of this merged range".

    If unmerging and duplicating the data would be a one-time thing, and you're interested, there's a way to do it fairly easily. WARNING: Try this out on a copy of your data before doing it on your actual data!
    1. Select the column with the merged cells by clicking on the column header
    2. Click the down arrow next to "Merge & Center" and select Unmerge Cells
    3. Hit ctrl+g to open the Go To window, and click Special
    4. Select "Blanks" and click OK. All of your empty rows should be selected.
    5. Type = and hit the up arrow, then hold ctrl and hit enter
    6. All of your merged cells should now be unmerged and filled with the correct data
    If someone helped achieve your solution, consider clicking "* Add Reputation" on their post.

    If your question has been answered, mark the thread as [SOLVED] using the Thread Tools menu at the top of the thread.

  7. #7
    Registered User
    Join Date
    05-07-2019
    Location
    Nashville, TN
    MS-Off Ver
    2016
    Posts
    10

    Re: Vlookup to pull FROM a merged cell

    Quote Originally Posted by Melvosh View Post
    If your merged cell groupings are variable (e.g. 2 cells, 4 cells, 3 cells, 2 cells) finding a single formula to account for that will be very difficult. Unfortunately, there's nothing in Excel that detects whether a cell is merged, except VBA, so there's no way in an Excel formula to say "go to the first part of this merged range".

    If unmerging and duplicating the data would be a one-time thing, and you're interested, there's a way to do it fairly easily. WARNING: Try this out on a copy of your data before doing it on your actual data!
    1. Select the column with the merged cells by clicking on the column header
    2. Click the down arrow next to "Merge & Center" and select Unmerge Cells
    3. Hit ctrl+g to open the Go To window, and click Special
    4. Select "Blanks" and click OK. All of your empty rows should be selected.
    5. Type = and hit the up arrow, then hold ctrl and hit enter
    6. All of your merged cells should now be unmerged and filled with the correct data
    Thank you! This is probably the best case scenario if there is no actual formula to run it while merged.

  8. #8
    Valued Forum Contributor
    Join Date
    01-07-2013
    Location
    Michigan
    MS-Off Ver
    O365
    Posts
    601

    Re: Vlookup to pull FROM a merged cell

    As an added step, you could then select the column, and do a Paste Special -> Values so you don't have the formulas in there. Thanks for the rep!

  9. #9
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Vlookup to pull FROM a merged cell

    Hi

    Try this for a non regular merged cells.
    A formula to sequential use
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    A formula to a single value in E4
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    See the file for clarification
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VLOOKUP with merged cell
    By Ran78 in forum Excel General
    Replies: 4
    Last Post: 11-29-2018, 12:24 PM
  2. Replies: 1
    Last Post: 09-27-2018, 11:22 AM
  3. Replies: 6
    Last Post: 07-31-2014, 01:27 PM
  4. Limit merged cell data; Place excess into next merged cell down
    By coreytroy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-06-2013, 10:35 PM
  5. get rid of blank options in pull down from merged cells
    By jed38 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-25-2012, 12:28 AM
  6. Excel 2007 : Vlookup help with merged cell data.
    By here.to.code in forum Excel General
    Replies: 3
    Last Post: 02-17-2011, 10:25 PM
  7. How do I pull a merged cell from another workbook?
    By foxspirit in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-07-2006, 12:47 PM

Tags for this Thread

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