+ Reply to Thread
Results 1 to 11 of 11

Reconciling Multiple Tables of Data Efficiently

  1. #1
    Registered User
    Join Date
    08-14-2012
    Location
    Missouri, USA
    MS-Off Ver
    PC Excel 365
    Posts
    12

    Reconciling Multiple Tables of Data Efficiently

    Update:
    This post is no longer an accurate reflection of what I'm trying to do. Please click here to see the latest state of the issue.

    ----

    Hello! This is my first time posting to the forum, so I apologize if this is in the wrong place, or if I break any of the usual practice around these parts.

    Here's the project I've got at work:
    • There is an online database of clients that have contacted my company, a leasing agency, in the past calendar year. This database can be downloaded as an excel document ("Doc A").
    • A separate company commissioned us to lease their properties.
    • They gave us an excel document ("Doc B") containing all those who have leased units from them in 2012.
    • Both documents contain thousands of entries, with fields for name, telephone, and contact number.
    • I am supposed to look at Doc B and determine which of their current tenants found out about the property through us.
      Process right now:
      • Start with the first entry on Doc B.
      • Search for an identical entry in Doc A.
      • If there is a match: highlight the entry in Doc A. They found out about the property through us.
      • If there is no match: ignore the entry in Doc B. They found out about the property through someone else.
    • Finally, I am supposed to submit a list of matches found in Doc A to my supervisor.

    Here's a list of things I'd like to do:
    • Find any macros, formulas, etc. to help automate any stage of this process.
      In particular:
      • Hide all empty rows and columns in the file. For some reason, the entries are each at least 15 cells apart when I open either document in excel.
      • Search for identical entries between two separate documents (or at least two separate sheets in the same document)
      • Gain results by searching for only a partial match (e.g. getting results with "johndoe@" vs. "johndoe@thisishislongemailaddress.com")
    • Sort list into "highlighted" and "not highlighted" (descending order) once it is finished.


    As ever, I'm on a tight schedule for this project. Does anyone have any help they could offer? I will give you all the positive vibes I can muster (which is a considerable amount).
    Last edited by EK923; 08-15-2012 at 03:43 PM. Reason: Changed the title to be more accurate.

  2. #2
    Registered User
    Join Date
    08-14-2012
    Location
    Missouri, USA
    MS-Off Ver
    PC Excel 365
    Posts
    12

    Re: Multiple Searches Across Multiple Documents [Looking for Help!]

    Quick Update

    I currently have all documents I need saved as separate sheets in a single document. What would be ideal at this point is a formula (maybe some kind of vlookup?) That searches for all instances of a particular value (in this case, an exact-text match of an email address) across multiple sheets. Does this exist?

    Thanks!

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Multiple Searches Across Multiple Documents [Looking for Help!]

    Hello there,

    What are you going to use to search for between the workbooks? By your post it seems like you maybe using e-mail addresses. If this is the case what column will the e-mail addresses be in in each workbook?

    Below is the code that will hide the rows that do not contains data for you assuming that data appears in column A.
    You'll need to change the text in red to your closed workbook's filename.

    Please Login or Register  to view this content.
    To insert this code into your workbook

    1. Open the workbook that you want to insert the code into and close the other.
    2. Press Alt+F11
    3. Press Alt, then press i and finally press m (individually not all at the same time)
    4. This should add a Module to your project
    5. copy and paste the above code into the blank space provided, anything that appears in green is a comment meant to help you understand the code.
    6. Close out of Visual Basic
    7. Press Alt+F8
    8. Select the test macro and then select Run

  4. #4
    Registered User
    Join Date
    08-14-2012
    Location
    Missouri, USA
    MS-Off Ver
    PC Excel 365
    Posts
    12

    Re: Multiple Searches Across Multiple Documents [Looking for Help!]

    Quote Originally Posted by rvasquez View Post
    What are you going to use to search for between the workbooks? By your post it seems like you maybe using e-mail addresses. If this is the case what column will the e-mail addresses be in in each workbook?
    At the moment, all documents have been consolidated into separate sheets in one document. Does that change anything?

    To answer your question, emails are in column G in the master list of contacts from my company, column L for sheets representing leases from March through June (4 sheets total) at the company that hired us, and column O for the month of July. The sheet for July was formatted differently than the other months, which explains the location discrepancy. Just to reiterate, what I need to do is search through Sheet 1 and highlight entries that match emails/names/numbers found in sheets 2-6.

    Quote Originally Posted by rvasquez View Post
    Below is the code that will hide the rows that do not contains data for you assuming that data appears in column A.
    You'll need to change the text in red to your closed workbook's filename.

    To insert this code into your workbook

    1. Open the workbook that you want to insert the code into and close the other.
    2. Press Alt+F11
    3. Press Alt, then press i and finally press m (individually not all at the same time)
    4. This should add a Module to your project
    5. copy and paste the above code into the blank space provided, anything that appears in green is a comment meant to help you understand the code.
    6. Close out of Visual Basic
    7. Press Alt+F8
    8. Select the test macro and then select Run
    I knew I forgot something into the OP! I'm running a Mac... how does that change things?

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    1,093

    Re: Multiple Searches Across Multiple Documents [Looking for Help!]

    At the moment, all documents have been consolidated into separate sheets in one document. Does that change anything?
    Yes it does, try this code:

    Please Login or Register  to view this content.
    To insert this code (at least on my computer, Windows)
    1. Press Alt+F8
    2. Clear the macro name field
    3. Type the word LpWorksheets
    4. Select the Create option
    5. In between the Sub LpWorksheets and End Sub copy and paste the above code
    6. Exit out of Visual Basic
    7. Press Alt+F8
    8. Select the LpWorksheets Macro and select run

    I knew I forgot something into the OP! I'm running a Mac... how does that change things?
    I'm not quite sure how this changes things I've never really worked with a Mac I'm sorry.


    To answer your question, emails are in column G in the master list of contacts from my company, column L for sheets representing leases from March through June (4 sheets total) at the company that hired us, and column O for the month of July. The sheet for July was formatted differently than the other months, which explains the location discrepancy. Just to reiterate, what I need to do is search through Sheet 1 and highlight entries that match emails/names/numbers found in sheets 2-6.
    It would be easier to help you if you could please provide an example workbook that mimics what you are trying to achieve. It's hard to guess what columns you will be searching in and where to look for information.

    If you could please provide a sample workbook that shows the current format of your data with dummy data that would be great.
    Last edited by rvasquez; 08-14-2012 at 02:37 PM.

  6. #6
    Registered User
    Join Date
    08-14-2012
    Location
    Missouri, USA
    MS-Off Ver
    PC Excel 365
    Posts
    12

    Re: Multiple Searches Across Multiple Documents [Looking for Help!]

    Quote Originally Posted by rvasquez View Post
    Yes it does, try this code:

    To insert this code (at least on my computer, Windows)
    1. Press Alt+F8
    2. Clear the macro name field
    3. Type the word LpWorksheets
    4. Select the Create option
    5. In between the Sub LpWorksheets and End Sub copy and paste the above code
    6. Exit out of Visual Basic
    7. Press Alt+F8
    8. Select the LpWorksheets Macro and select run

    I'm not quite sure how this changes things I've never really worked with a Mac I'm sorry.
    I tried to find a solution on google, but I'm not sure what exactly I'm looking for. What is this coding process called? I searched for "excel mac visual basic editor tutorial" and came up with nothing helpful.

    Quote Originally Posted by rvasquez View Post
    It would be easier to help you if you could please provide an example workbook that mimics what you are trying to achieve. It's hard to guess what columns you will be searching in and where to look for information.

    If you could please provide a sample workbook that shows the current format of your data with dummy data that would be great.
    Please find a very rough mock-up of my current file attached here: Workbook Solutions 8.14.12.xlsx

    As you can tell, at the moment I've written a quick vlookup, which is better than nothing. It's still pretty lackluster to think about all the thousands of copy/paste actions I'll need to do to get this project finished like this. Any thoughts?

    Thanks again!

  7. #7
    Registered User
    Join Date
    08-14-2012
    Location
    Missouri, USA
    MS-Off Ver
    PC Excel 365
    Posts
    12

    Re: Multiple Searches Across Multiple Documents [Looking for Help!]

    Here's my latest idea.

    Excel Sorting Question 8.15.12.xlsx

    Basically, I'd like to know if it's possible to take two separate tables of data and sort them in such a way that matches appear on the same row, while non-matches are placed into their own row. It seems like something that would be a simple feat with the right code, I just don't know it!

    Any help is greatly appreciated.

  8. #8
    Registered User
    Join Date
    08-14-2012
    Location
    Missouri, USA
    MS-Off Ver
    PC Excel 365
    Posts
    12

    Re: Reconciling Multiple Tables of Data Efficiently

    Latest Update:

    I'm confident that I can get by with a VLOOKUP formula, but I'm not sure how it needs to be written.

    The latest issue is that (for whatever absurd reason) all cells containing an email address in Table 2 begin with three spaces (e.g. " 123@email.com").

    If I can figure out some formula that will automatically delete all of these spaces, I think I can do what I need to do. I've tried a LEFT formula to pull everything after those initial three spaces, but the formula isn't working.

    Question: Is there a formula to remove the three blank spaces from the beginning of these cells?

  9. #9
    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: Reconciling Multiple Tables of Data Efficiently

    Quote Originally Posted by EK923 View Post

    The latest issue is that (for whatever absurd reason) all cells containing an email address in Table 2 begin with three spaces (e.g. " 123@email.com").

    If I can figure out some formula that will automatically delete all of these spaces, I think I can do what I need to do. I've tried a LEFT formula to pull everything after those initial three spaces, but the formula isn't working.

    Question: Is there a formula to remove the three blank spaces from the beginning of these cells?
    Hi,

    =TRIM(A1)

    In an earlier post you mentioned Excel for Mac although your profile details say you are using Excel 2010 - which implies Excel for Windows.
    If you are using a Mac then be aware that there are certain differences with VBA (macro) syntax.
    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.

  10. #10
    Registered User
    Join Date
    08-14-2012
    Location
    Missouri, USA
    MS-Off Ver
    PC Excel 365
    Posts
    12

    Re: Reconciling Multiple Tables of Data Efficiently

    @Richard:
    I've tried the TRIM function already with no results. I've also tried CLEAN. I've even tried LEFT and RIGHT to try and extract the emails into another cell, but none of it is working.

    Here is a copy/paste from the workbook. I don't know if this will help you, but it's all I've got to offer.
    \/
    ***4/12/2012
    /\
    I even tried finding something online that would allow me to figure out which ASCII code the spaces are, then targeting that specifically with one of the above formulas. Dead ends at every turn.

  11. #11
    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: Reconciling Multiple Tables of Data Efficiently

    In that case maybe the 'spaces' are not spaces in fact and are some other non visible character.

    To identify if this is the case enter the function

    =CODE(LEFT(A1,1)) and see what value it returns.

    Once you know that you can use the normal Find and Replace to remove that character code.

    Upload the workbook or at least a representative sample if you still have trouble

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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