+ Reply to Thread
Results 1 to 6 of 6

merge If adjacent cells are the same

  1. #1
    Registered User
    Join Date
    07-27-2012
    Location
    Sydney Aust
    MS-Off Ver
    Excel 2010
    Posts
    92

    merge If adjacent cells are the same

    I would like to merge the 2 or more cells together if the cells to the left are the same.

    e.g i am trying to merge "long" togther

    if c2=c3 and b2=b3 and a2=a3 then merge c2 with c3
    =IF(AND(C2=C3,B2=B3,A2=A3)) then merge c2:c3
    then move down and do it again
    then once at the end move left and start from the top
    then left again

    I cant just merge cells that are the same as the grouping will not work like in Gp2 John- tie- big and Paul-Tie-Long

    merge cells test.xlsm


    Gp1 Gp2 Gp3 Selection
    john Hat Long Red
    john Hat Long Green
    john Hat Short yellow
    john Pants Short yellow
    john Pants Long blue
    john Pants Medium orange
    john Pants Extra Long Red
    john Tie big Green
    Paul Tie Long yellow
    Paul Shoes Long Red
    Paul Shirt Short Green
    Paul Shirt Short yellow
    Paul Socks Long yellow
    Paul Shoes Medium blue
    Paul Shirt Extra Long Red
    Paul Shirt big Green
    Paul Hat Long yellow
    Paul Hat Medium yellow
    Paul Pants Extra Long blue
    Ringo Pants big orange
    Ringo Pants Long yellow
    Ringo Hat Long blue
    Ringo Hat Long orange
    Ringo Pants Medium Red
    Ringo Hat Extra Long Green
    Ringo Hat big blue
    Ringo Pants Long orange
    Ringo Pants Long yellow
    Ringo Pants Very short blue

  2. #2
    Forum Contributor Bhuvi's Avatar
    Join Date
    04-19-2013
    Location
    Delhi, India
    MS-Off Ver
    MS Excel 2003,07,10
    Posts
    153

    Re: merge If adjacent cells are the same

    Hii,

    You can get this layout with help of a pivot table. See the attached sheet. It's pretty easy.
    Attached Files Attached Files
    If this helped and you wish to say thanks, then Please click on the Star* icon below this post.

  3. #3
    Registered User
    Join Date
    07-27-2012
    Location
    Sydney Aust
    MS-Off Ver
    Excel 2010
    Posts
    92

    Re: merge If adjacent cells are the same

    Yes i love the pivot table but from that pivot table I am unable to do the next part of the operation which is selecting a cell and then getting that value into another sheet.

    So in this case i would like to be able to put a "true" in Column E and then run a macro to grab what ever rows have true and put that whole row into another sheet.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: merge If adjacent cells are the same

    Try the attached
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-27-2012
    Location
    Sydney Aust
    MS-Off Ver
    Excel 2010
    Posts
    92

    Re: merge If adjacent cells are the same

    Jindon

    That is awesome.

    Now I have to try and figure out each part of the code so that i can get it to work on other workbooks I have.

    Thank you very much for your help.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: merge If adjacent cells are the same

    Can you mark the thread as "SOLVED"?

+ 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. Merge Cells based on an adjacent row of values
    By Metal Head in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2011, 09:55 AM
  2. timekeeping, merge & sort non-adjacent cells
    By BeatBama in forum Excel General
    Replies: 1
    Last Post: 01-14-2011, 12:16 PM
  3. merge & sort non-adjacent cells
    By BeatBama in forum Excel General
    Replies: 8
    Last Post: 01-12-2011, 02:11 PM
  4. How to merge date from adjacent cells inbetween current cells
    By hdawson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-18-2009, 08:03 PM
  5. Replies: 4
    Last Post: 05-16-2005, 01:07 AM

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