+ Reply to Thread
Results 1 to 13 of 13

Vlookup and merged cells

  1. #1
    Registered User
    Join Date
    01-27-2015
    Location
    Bosnia and Herzegovina
    MS-Off Ver
    Microsoft office 365 ProPlus
    Posts
    52

    Vlookup and merged cells

    Hello all,

    Help would be much appreciated on how to:

    One table has employee source data.
    Some Unique numbers are reoccurring (1 employee is repetitive due to product range).
    I know how to merge Unique numbers under one (using index and counta formula - range of Unique numbers is over 10k).

    Now, once this is sorted into merged cell, I can vlookup basic information (name, last name, etc...)based on unique ID in merged cell.
    However, when it comes to collecting data associated with that Unique ID from (CURRENT TABLE) it only gets me one value across - first one, i.e. PRODUCT 1, PRODUCT 1, PRODUCT 1, PRODUCT 1etc..
    How to get all other values?

    Hope i was clear.
    Thanks.


    Capture.PNG

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Vlookup and merged cells

    Did you read this first?
    mergedcells.jpg

    don't merge cells, set white color of fonts for unnecessary cells
    Last edited by sandy666; 04-25-2017 at 12:27 PM.

  3. #3
    Registered User
    Join Date
    01-27-2015
    Location
    Bosnia and Herzegovina
    MS-Off Ver
    Microsoft office 365 ProPlus
    Posts
    52

    Re: Vlookup and merged cells

    Hi Sandy
    Thanks for the advice, however, its going to take like forever to clear in such way for i have over 10.000 entries to match.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Vlookup and merged cells

    Assuming your data starts in row 3, in G3 copied down, try this formula

    =INDEX($C$3:$C$13,AGGREGATE(15,6,(ROW($C$3:$C$13)-ROW($C$3)+1)/($A$3:$A$13=INDEX($E$3:$E3,MATCH(9^99,$E$3:E3))),ROWS($G$3:G3)-MATCH(9^99, $E$3:E3)+1))
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    01-27-2015
    Location
    Bosnia and Herzegovina
    MS-Off Ver
    Microsoft office 365 ProPlus
    Posts
    52

    Re: Vlookup and merged cells

    Hi Chemist,

    This looks too complicated to i tried to put it as such but its not going through. can you attach your eample please.
    BR,

    HK

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Vlookup and merged cells

    I could put up an example like you did but that's not very useful. Attached is the example
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    01-27-2015
    Location
    Bosnia and Herzegovina
    MS-Off Ver
    Microsoft office 365 ProPlus
    Posts
    52

    Re: Vlookup and merged cells

    Hi Chemist,

    Thank you for attached example. Ill try to replicate on actual table and let you know if it works.
    BR,
    HK

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Vlookup and merged cells

    Honestly, Hkaric.... don't do it. Merged cells are a disaster in a sheet of data. You will find any sort of subsequent manipulation difficult or impossible. What you are starting with is a PERFECT data layout - one row one data unit. Don't f*** it up by using merged cells.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  9. #9
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Vlookup and merged cells

    How about inserting 2 columns to give you the look you want (insert before column A) then hide current columns A and B
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  10. #10
    Registered User
    Join Date
    01-27-2015
    Location
    Bosnia and Herzegovina
    MS-Off Ver
    Microsoft office 365 ProPlus
    Posts
    52

    Re: Vlookup and merged cells

    Hi Glen, I know they are... that's why I am look for solution.
    Maybe a new sheet will shed some light on it... if anyone has an idea how to get from A to B, well much appreciated.
    Please note that entries are limited here but never-ending in real life MergeBook.xlsx
    and Kev, when you see it... I don't think its gonna work.
    Thanks,

  11. #11
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Vlookup and merged cells

    Building off of Sandy's suggestion above, you could use conditional formatting to color all of the unwanted fonts white at once. If your data is in A3:C16, select A3:B16 and add a new conditional formatting rule with the following formula:

    =ROW($A3)-1<>ROUNDUP(COUNTIF($A$3:$A$16,$A3)/2,0)+MATCH($A3,$A$3:$A$16,0)

    Select white font and it should white out the undesired entries. It's not perfectly centered for entries with an even number of rows, but it looks decent and leaves your data in place for future calculations and lookups.

    To add a break between IDs, create a new CF rule for A3:C16 with the following formula:

    =$A3<>$A2

    ...and format the rule to only add a top border. You can add vertical borders easily enough without CF.

    Here's how it looks on ChemistB's sample:
    Attached Files Attached Files
    If your problem has been solved, please use "Thread Tools" to mark the thread as "Solved".

    If you're grateful for this site's existence and would like to contribute to the community, please consider posting something hilarious in our joke thread:
    https://www.excelforum.com/the-water...ke-thread.html

  12. #12
    Registered User
    Join Date
    01-27-2015
    Location
    Bosnia and Herzegovina
    MS-Off Ver
    Microsoft office 365 ProPlus
    Posts
    52

    Re: Vlookup and merged cells

    Hi CAntosh,

    Thanks a lot for this. Works great. Can you help me out with one more addition on formatting as an edition to this:
    Lets say i want to add 1-2 rows, would it be possible to color format inserted row, alternately first cell (unique ID)?

    Thanks

  13. #13
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Vlookup and merged cells

    I'm not sure I'm understanding your request correctly - you want to use conditional formatting to highlight the most recently entered row? Will that row always be at the bottom, or could it be anywhere? Do you want the highlight to go away once all 3 columns have been filled in that new row, or should it stay highlighted even after that?

    To my knowledge, it's possible to use conditional formatting to highlight the bottom row. It's also possible to use conditional formatting to highlight a row in which data has been entered in one column but not (yet) in another column. If you want either of those two effects, we can do that with formatting. If you want the "newest" row to be highlighted regardless of where it is or whether or not the columns are full, we would need VBA for that.

+ 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 cells
    By looeej in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-20-2016, 12:24 AM
  2. Using Vlookup when cells are merged
    By Raoel05 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-02-2013, 08:34 AM
  3. VLOOKUP for merged cells
    By Spreadsheet in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-27-2013, 05:48 PM
  4. How do I use the vlookup function with merged cells?
    By kevin76 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-22-2013, 08:30 PM
  5. Using Vlookup with merged cells...
    By Regnab in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-10-2013, 09:39 AM
  6. Excel 2007 : Vlookup with Grouped/Merged Cells
    By Ronn BenHarav in forum Excel General
    Replies: 3
    Last Post: 06-10-2010, 10:46 AM
  7. [SOLVED] VLOOKUP across merged cells
    By WAR in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-28-2005, 02:05 PM

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