+ Reply to Thread
Results 1 to 8 of 8

formula to consolidate tables

  1. #1
    Registered User
    Join Date
    03-21-2014
    Location
    Diss, Norfolk, England
    MS-Off Ver
    Microsoft 365 Excel
    Posts
    57

    formula to consolidate tables

    Hi - I need desperate help!
    I have a table (Table 1) with unique index numbers in Column A and names in Column B. For example:
    A16 John
    R6O Sally
    69U Henry
    I have a separate table (Table 2), with same index numbers repeating in column A from (also appearing in column A from Table 1) but different names. For example:
    A16 Roger
    A16 Paul
    A16 Owen
    R60 Frank
    R60 Linda
    69U Howard
    69U Diana

    My objective is to have Table 1 with all names on same row corresponding to the index number in column A and names consolidated from column B, C, D E until no more names appear for that index number. For example:
    A16 John Roger Paul Owen
    R60 Sally Frank Linda
    69U Henry Howard Diana

    Is there a formula I can easily use that will do this for me?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: formula to consolidate tables

    You may find that listing table 1 under the other and then using a Pivot Table gives you the information you want although not in quite the same layout.

    Alternatively use the formulae in columns C & D of the attached and then perform a TextToColumns on column D if you want the names in separate cells.
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    03-21-2014
    Location
    Diss, Norfolk, England
    MS-Off Ver
    Microsoft 365 Excel
    Posts
    57

    Re: formula to consolidate tables

    Hi Richard. Thanks for the prompt reply.
    I was perhaps over-simplified in my request. Enclosed is an example of Table 1 with the source, Table 2 with the added info and Table 3 with the desired results.
    You will note that table 2 hasn't got the codes in any logical order. Table 3 has a test area where I highlighted in yellow what I require.
    I made an effort in able 3 (range B6:C9) but need the rest populated - Help!!
    I am no good with Pivot tables and would prefer a formula. If VBA is easier, then I am happy to take any advice and sample VBA code.
    Thanks again,
    Attached Files Attached Files

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: formula to consolidate tables

    What's the essential task here. Is it to produce a table of codes/names and ages, and is it vital that the table looks exactly as you have originally designed it?
    And are you wanting to fill in the blanks where there are missing ages?

    If so you're making it much harder than it need be.

    Pivot Tables take seconds to produce from a table of data and it really would pay you to spend half an hour or so getting to grips with them.
    With the attached you can see that I added Table 2 below the data on Table 2 and then created two Pivot Tables in A13 & R13 with different layouts.

    If you're wanting to add ages which are missing then the smart thing to do is to add the age to the underlying data table then refresh the pivot tables. You can't change individual cells in a pivot table without changing the underlying data, so if you really wanted to add data to the resulting table you'd need to copy the whole of the Pivot Table and paste somewhere else as Values as a normal table where you could add numbers to cells.

    The layout you are asking for is possible with formulae but in my opinion it's complicating things unnecessarily since you have alternating columns of names and ages, and it's not clear how far across you'd need to copy the formulae unless you count the unique names first. A Pivot Table does all this automatically in seconds.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-21-2014
    Location
    Diss, Norfolk, England
    MS-Off Ver
    Microsoft 365 Excel
    Posts
    57

    Re: formula to consolidate tables

    Thanks again, Richard.
    The intention/objective is to have a consolidated table that we can use for Mail-Merge purposes; therefore, I don't believe a Pivot Table is appropriate. The "output" has to be exactly in the format defined in the enclosed "Desired Result" worksheet. Bear in mind, Sheet1 and Sheet2 (samples enclosed) are in fact very lengthy and extensive (further details for each candidate is available). For purposes of this exercise, however, I've re-created a similar set of tables (enclosed) in a cut-down version. Once I have a grip of the formula needed, I can work out the rest (I hope). From the enclosed workbook, you can see in Sheet3 (highlighted in yellow) my failed attempt, as it is not using the right data when using INDEX, so I know I am not doing this right and need expert guidance, if possible.
    In effect, the common index identifier is always unique(the code in columns A) on both Sheet1 and Sheet2. I am trying to come up with a table (Sheet3) that has all the details lined-up in a single row (repeating pattern) for each of the codes found I column A. Therefore, VLOOKUP worked to a certain extend, but this is where I got stuck (brain-blocked). Hope you (or someone) can advice best way forward. I hate to copy & paste loads of cells - too laborious and pen to errors. Can you help?
    Attached Files Attached Files

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: formula to consolidate tables

    OK,

    Add a helper column F to the CC Contacts sheet, in F3 copied down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    There's a typo in A9 on the Results sheet. R6O should be R60. i.e. 0 not capital O

    Now in F8 on the Results sheet copied across and down

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Also see attached.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-21-2014
    Location
    Diss, Norfolk, England
    MS-Off Ver
    Microsoft 365 Excel
    Posts
    57

    Re: formula to consolidate tables

    Ah, you've come through for me! Million thanks, Richard.

  8. #8
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: formula to consolidate tables

    Quote Originally Posted by Kausch View Post
    Ah, you've come through for me! Million thanks, Richard.
    My pleasure.

+ 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. Using a macro to consolidate 3 tables of data into 1 table
    By fpritt24 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-23-2016, 03:43 PM
  2. consolidate 2 tables into one
    By dekel in forum Excel General
    Replies: 1
    Last Post: 07-09-2012, 04:32 AM
  3. Consolidate Multiple Data Tables
    By dangermouse1981 in forum Excel General
    Replies: 5
    Last Post: 07-15-2011, 12:04 PM
  4. Consolidate two pivot tables
    By ekat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-16-2010, 11:46 AM
  5. How to consolidate all the excel tables into one table?
    By tanks1308 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-14-2007, 08:07 AM
  6. [SOLVED] Consolidate Pivot Tables
    By JS in forum Excel General
    Replies: 1
    Last Post: 06-30-2006, 02:50 PM
  7. [SOLVED] How do you consolidate tables contianing text?
    By samenvoegen van sheets in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-22-2006, 06:10 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