+ Reply to Thread
Results 1 to 17 of 17

How to Join Two Excel Files Consolidate Files

  1. #1
    Registered User
    Join Date
    03-06-2014
    Location
    Louisiana
    MS-Off Ver
    Excel 2010
    Posts
    7

    How to Join Two Excel Files Consolidate Files

    I have two files. One is a main file with lots of information(name, address, phone, race, etc.) The second file is a voters historical file. The two files SHARE a registration number. I am trying to sort and filter data from the historical file. Then take the SHARED registration number for the filtered data and pull all of the additional information needed from the main/master file. I do not know how to join or consolidate the two files and sort different data from the main file.

    EXAMPLE:
    From the MOCK VOTING HISTORY excel file: sort and filter all voters who voted on 3/27/2010 from the MOCK VOTERS HISTORY.

    Then take the LINKED registration number (who voted 3/27/10) from MOCK VOTING HISTORY File to find the voters name, address, race, phone number, etc. from the MOCK MAIN FILE.

    Thanks in advance,
    danitydazzle
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: How to Join Two Excel Files Consolidate Files

    This is an ideal situation for Access. Do you a copy available to you?

    EDIT: If you do not have Access available, then Excel has provided in each version a copy of MS Query which you can use to write a SQL statment to join two or more tables and set criteria and query the joined tables.

    Here is a tutorial on using MS Query if you have never used it before. I tested your data using both Access and MS Query and got the same results from both for the criteria you provided.

    http://exceluser.com/formulas/msquer...ional-data.htm
    Last edited by alansidman; 03-07-2014 at 12:25 AM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: How to Join Two Excel Files Consolidate Files

    Hi danitydazzle..

    So do you want the info that gets pulled from the Mock Main File.xlsx file to be inserted into a new 3rd Workbook?

    Also..
    voters name, address, race, phone number, etc.
    Can you be exact and specific about which columns you want data pulled from..

  4. #4
    Registered User
    Join Date
    03-06-2014
    Location
    Louisiana
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: How to Join Two Excel Files Consolidate Files

    I need all information from the Main File for that Registration Number.

  5. #5
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: How to Join Two Excel Files Consolidate Files

    Hi..

    Select the Date value in Column C of your History Sheet and press the Button.. results shown on Sheet1..

    Change the filepath of your Mock Main File to suit..

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    03-06-2014
    Location
    Louisiana
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: How to Join Two Excel Files Consolidate Files

    I am still unable to do this. I CAN sort and filter election date for only 3/27/2010. But now I need to pull all information from the main file for the filtered registration number only and put in a separate worksheet in the main file or a separate file. HELP.

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: How to Join Two Excel Files Consolidate Files

    Have you considered my suggestion?

    Alan

  8. #8
    Registered User
    Join Date
    03-06-2014
    Location
    Louisiana
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: How to Join Two Excel Files Consolidate Files

    Trying to find the simplest way to do this. Can the function vlook up work?

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: How to Join Two Excel Files Consolidate Files

    Vlookup will only return the first value it finds. If you are looking for multiple values then it will fail.

    In my opinion, the simplest way is with Access. The second simplest way is with MS Query. You can change your criteria and get results very quickly especially if you have large tables to deal with.

  10. #10
    Registered User
    Join Date
    03-06-2014
    Location
    Louisiana
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: How to Join Two Excel Files Consolidate Files

    Quote Originally Posted by danitydazzle

    Yes I tried. I am not sure how to sort the data first then use the main file to pull all of the personal information.

  11. #11
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: How to Join Two Excel Files Consolidate Files

    Attached is a simple db in Access that uses the two files you provided. In one query, it retrieves all voters for 3/27/10 as you requested. In the second one it retrieves the voter you will list in the parameter by registration and some of their personal info (address only in this case) and all the dates that they voted.

    I do not understand at all what your last post means.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    03-06-2014
    Location
    Louisiana
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: How to Join Two Excel Files Consolidate Files

    I am using MS Query. Thanks for the guidance. I was able to generate the first request Voters in the 3/27/2010 query. Now how do I query all voters that DID NOT in that particular election date-- 3/27/2010? The problem is the voters history file shows a list of ALL dates voted per registration number. And the Main File has a column with LAST DATE VOTED. When I queried <>3/27/2010 to remove the 3/27/2010, it returned multiple dates voted and I just need a list of names without each date voted. I hope I am making sense...

    I need a list of all registered voters who did not vote on March 27, 2010. I don't need every date the voter actually voted.. Just the last date voted and all of their personal information.

    Thank you. Thank you.

  13. #13
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: How to Join Two Excel Files Consolidate Files

    This will take a couple of queries. To keep it simple I would only use the Registration number and Dates field. Once you have identified your population, you can go back and join the last query to the Main Table to get the personal data you require.

    1. Create a query to get those registrants that voted on March 27
    2. Create a second query to get those registrants that did not vote on March 27 (this will be a list of many with multiple dates)
    3. Create a query joining the second and first query with a Left Join putting the second query on the left and the first query on the right.
    4. Include the registrant number and date from the second query. Include the registrant number from the first.
    5. In the criteria for the second registrant number put Is Null.
    6. This should give you all registrants that did not vote on 3/27/10. You may have to run one more query to get unique registrants.

  14. #14
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: How to Join Two Excel Files Consolidate Files

    Updated Access to show you queries.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    03-06-2014
    Location
    Louisiana
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: How to Join Two Excel Files Consolidate Files

    GUIDANCE NEEDED. Ok, I was able to make the two queries 1. 3/27/10 election date and reg number only, and 2. all voters minus 3/27/10. Each saved as .dqy. I did not save as an excel file. Then I opened excel and went to get external data source; what to choose for the new data source or dp I choose the query tab ?
    I picked the query tab but it did not work or allowed me to pick two queries to join.. PLEASE ADVISE>
    how do you choose the two queries and make as tables to join?

    3. HOW TO DO THIS? Create a query joining the second and first query with a Left Join putting the second query on the left and the first query on the right.

    4. Include the registrant number and date from the second query. Include the registrant number from the first.
    5. In the criteria for the second registrant number put Is Null.

  16. #16
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: How to Join Two Excel Files Consolidate Files

    I'm a little rusty using MS Query. I will have to play with it this weekend.

  17. #17
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,885

    Re: How to Join Two Excel Files Consolidate Files

    I'll take this in pieces.
    1. to join each query, you must save the results of each to an excel sheet and then bring the results into the QBE as a table. I would turn off the wizard so that you can do this manually.
    2. Join them as you normally would. Once joined, double click on the join line, and a new popup will appear allowing you to make the join a left or right.

+ 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. how do I join multiple excel files into 1 file?
    By John in forum Excel General
    Replies: 7
    Last Post: 08-05-2015, 10:56 AM
  2. VBA code to consolidate multiple excel files into one workbook.
    By krazyhype19 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-30-2014, 06:46 AM
  3. Macro to consolidate excel files in one database file
    By VKR in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2013, 02:18 AM
  4. [SOLVED] How to consolidate data from multiple excel files to one from a https:// location??
    By Kiran2012 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-24-2012, 05:49 AM
  5. Replies: 4
    Last Post: 03-15-2007, 06:53 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