+ Reply to Thread
Results 1 to 3 of 3

Conditionally merge rows to columns

  1. #1
    Registered User
    Join Date
    09-12-2014
    Location
    Sweden
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    2

    Conditionally merge rows to columns

    Hi all,

    I'm not sure if this can be done in Excel or not, I don't know what to google for either, so my apologies if this can be found in this forum. I made an effort without success.

    So, problem is simple. I have a column A which contains names, there can be several rows with the same name, columns B-C containing different things then.

    Skärmdump 2014-09-12 10.13.42.png

    The goal is to collect all of the same name and merge them to one row only. Can this be done?

    Skärmdump 2014-09-12 10.16.25.png

    Many thanks in advance.

  2. #2
    Registered User
    Join Date
    08-26-2014
    Location
    Scotland
    MS-Off Ver
    Office 2007, 2010, 2013
    Posts
    3

    Re: Conditionally merge rows to columns

    Assuming this is a one-off spreadsheet tidy up exercise, it can be done relatively simply:
    With the ranges of your image and assuming that (as in your picture) repeat names follow in subsequent rows (if they don't I'd recommend sorting, both so below will work, and because it will make checking easier if repeat names are together):
    D2 formula: =IFERROR(VLOOKUP(A2,OFFSET(A2,1,0):OFFSET(C2,6,0),2,FALSE),"")
    (looks up in a range starting in column A in the row below to column C row 6 (substitute your last row with data) for value in column B). Fill down.
    E2 formula: =IFERROR(VLOOKUP(A2,OFFSET(A2,1,0):OFFSET(C2,6,0),3,FALSE),"")
    (looks up in a range starting in column A in the row below to column C row 6 (substitute your last row with data) for value in column C). Fill down.
    F2 formula: =IFERROR(VLOOKUP(A2,OFFSET(A2,2,0):OFFSET(C2,6,0),2,FALSE),"")
    (as for the second car but offsets two rows). Fill down.
    G2 formula: =IFERROR(VLOOKUP(A2,OFFSET(A2,2,0):OFFSET(C2,6,0),3,FALSE),"")
    (as for second car but offsets two rows). Fill down.
    Convert to values once checked then remove duplicates (select full range, data, remove duplicates, selecting only column A).

    I am sure it can be done more elegantly, but assuming this doesn't have to be done again and again, this will do the trick.

  3. #3
    Registered User
    Join Date
    09-12-2014
    Location
    Sweden
    MS-Off Ver
    Excel 2011 (Mac)
    Posts
    2

    Re: Conditionally merge rows to columns

    Hi Adaptable,

    thanks for your help! Sounds like a good approach, I couldn't make it work though. Maybe a version issue, I'll keep on trying

+ 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. Best Way to Conditionally Format Range (Multiple Columns and Rows)?
    By freybe06 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-14-2013, 04:53 PM
  2. Merge Duplicate Rows unique values into single rows for an infinite amount of columns/rows
    By aimeecrystalaid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2013, 08:43 PM
  3. Moving rows and columns to new sheets conditionally
    By twrimshot in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-16-2013, 12:48 PM
  4. [SOLVED] Merge multiple duplicate rows into columns - more than 65536 rows
    By a3des in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-05-2013, 09:18 AM
  5. [SOLVED] Merge duplicate rows and merge the columns (approx 10 columns)
    By adfeddon in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-02-2012, 11:19 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