+ Reply to Thread
Results 1 to 17 of 17

Merging variables from two separate tables into a separate table

  1. #1
    Registered User
    Join Date
    06-20-2018
    Location
    KwaDukuza; South Africa
    MS-Off Ver
    Office 2016
    Posts
    11

    Merging variables from two separate tables into a separate table

    Good day,

    My First posting on this forum!

    I have a table with driver details, and a separate table with vehicle details. The vehicles aren't always driven by the same driver.

    I need to issue Trip authorities to drivers, and I was wondering how to go about getting a result table showing collated data from the driver and vehicles tables into a new table.

    Greatly appreciate any help in solving this for me.

    Thanks in advance.

    Quintin

  2. #2
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Merging variables from two separate tables into a separate table

    Generally, you need to create or establish some sort of relationship between the 2 tables/data sets. Without a sample file its hard to say exactly how you should do this as we have no reference to work from.

    Hopefully, you have a unique identifier or can combine multiple fields to produce one. This would give a way to relate the data on both sheets and consolidate them.

    I usually explain the concept this way;

    You can make Excel practically do anything in which a measurable pattern is present. If x and y are here do z...If however the logic is that you've worked there for 20 years and you "just know" that x matches z "because", thats not something you can usually get Excel (or a computer in general) to follow and understand.

    So we need something on each sheet that makes a record on one sheet and a record on another sheet match, or be related. Without that its arbitrary. It can be as simple as a single column with unique ID's or it can be a complex relationship based on various criteria.
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

  3. #3
    Registered User
    Join Date
    06-20-2018
    Location
    KwaDukuza; South Africa
    MS-Off Ver
    Office 2016
    Posts
    11

    Re: Merging variables from two separate tables into a separate table

    Sorry, not sure how to attach file.

    Newby can't post dropbox link to file either.

    Basically: One table has vehicle details, second has driver details, third links driver with vehicle.

    Need forth table to populate combing details from first two as a result of third table.

    Thanks again.

  4. #4
    Registered User
    Join Date
    06-20-2018
    Location
    KwaDukuza; South Africa
    MS-Off Ver
    Office 2016
    Posts
    11

    Re: Merging variables from two separate tables into a separate table

    Driver and Vehicle Plate Number are unique in first two tables.

  5. #5
    Forum Contributor
    Join Date
    05-16-2018
    Location
    Pittsburgh, PA
    MS-Off Ver
    2016
    Posts
    109

    Re: Merging variables from two separate tables into a separate table

    Go Advanced (bottom of thread)
    Additional Options Box (bottom of post reply box)
    Attachments, click manage attachments
    Upload from computer or wherever, click Upload
    Close window,
    Then Submit Reply

  6. #6
    Registered User
    Join Date
    06-20-2018
    Location
    KwaDukuza; South Africa
    MS-Off Ver
    Office 2016
    Posts
    11

    Re: Merging variables from two separate tables into a separate table

    I've attached file now.

    Top section is Vehicle details. KZN Reg unique for vehicle
    Middle section link driver with vehicle
    Bottom section Driver details- Surname unique.

    Hope this makes sense.

    Thanks in advance.

    Quintin
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    06-20-2018
    Location
    KwaDukuza; South Africa
    MS-Off Ver
    Office 2016
    Posts
    11

    Re: Merging variables from two separate tables into a separate table

    Didn't have quote.
    Last edited by QuintinZN; 07-04-2018 at 03:30 AM. Reason: Didn't make sense.

  8. #8
    Registered User
    Join Date
    06-20-2018
    Location
    KwaDukuza; South Africa
    MS-Off Ver
    Office 2016
    Posts
    11

    Re: Merging variables from two separate tables into a separate table

    Quote Originally Posted by AMoreno View Post
    Go Advanced (bottom of thread)
    Additional Options Box (bottom of post reply box)
    Attachments, click manage attachments
    Upload from computer or wherever, click Upload
    Close window,
    Then Submit Reply
    Thanks. Great help.

  9. #9
    Registered User
    Join Date
    06-20-2018
    Location
    KwaDukuza; South Africa
    MS-Off Ver
    Office 2016
    Posts
    11

    Re: Merging variables from two separate tables into a separate table

    Quote Originally Posted by Zer0Cool View Post
    Generally, you need to create or establish some sort of relationship between the 2 tables/data sets. Without a sample file its hard to say exactly how you should do this as we have no reference to work from.

    Hopefully, you have a unique identifier or can combine multiple fields to produce one. This would give a way to relate the data on both sheets and consolidate them.

    I usually explain the concept this way;

    You can make Excel practically do anything in which a measurable pattern is present. If x and y are here do z...If however the logic is that you've worked there for 20 years and you "just know" that x matches z "because", thats not something you can usually get Excel (or a computer in general) to follow and understand.

    So we need something on each sheet that makes a record on one sheet and a record on another sheet match, or be related. Without that its arbitrary. It can be as simple as a single column with unique ID's or it can be a complex relationship based on various criteria.
    I've attached a sample file now! Three sections: Driver; Vehicle and link for consolidation.

    Please assist me.

    Thank you

    Quintin

  10. #10
    Registered User
    Join Date
    06-20-2018
    Location
    KwaDukuza; South Africa
    MS-Off Ver
    Office 2016
    Posts
    11

    Re: Merging variables from two separate tables into a separate table

    Quote Originally Posted by Zer0Cool View Post
    Generally, you need to create or establish some sort of relationship between the 2 tables/data sets. Without a sample file its hard to say exactly how you should do this as we have no reference to work from.

    Hopefully, you have a unique identifier or can combine multiple fields to produce one. This would give a way to relate the data on both sheets and consolidate them.

    I usually explain the concept this way;

    You can make Excel practically do anything in which a measurable pattern is present. If x and y are here do z...If however the logic is that you've worked there for 20 years and you "just know" that x matches z "because", thats not something you can usually get Excel (or a computer in general) to follow and understand.

    So we need something on each sheet that makes a record on one sheet and a record on another sheet match, or be related. Without that its arbitrary. It can be as simple as a single column with unique ID's or it can be a complex relationship based on various criteria.
    I've attached a file now, Please assist.

    Thanks in advance.

    Quintin

  11. #11
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Merging variables from two separate tables into a separate table

    Quote Originally Posted by QuintinZN View Post
    I have a table with driver details, and a separate table with vehicle details. The vehicles aren't always driven by the same driver.

    I need to issue Trip authorities to drivers, and I was wondering how to go about getting a result table showing collated data from the driver and vehicles tables into a new table.
    Can you please elaborate on what you have and what you want to accomplish? I looked at the sample and its not clear if this is the format you work with or the result you want to accomplish or both.

    Ideally, a sample file should:
    • Replicate the structure and types of data in your actual file
    • Illustrate what you have and what your goal is
    • Include any notes/comments that may help others understand the file

    It would also be helpful to describe things here as it relates to the sample file, IE:

    " I have a table for drivers in A1:B10 on Sheet1..."

    vs

    "I have a table of drivers and want..."

    In doing the above we can more easily follow your description and understand exactly what needs to be manipulated in the file.

  12. #12
    Registered User
    Join Date
    06-20-2018
    Location
    KwaDukuza; South Africa
    MS-Off Ver
    Office 2016
    Posts
    11

    Re: Merging variables from two separate tables into a separate table

    Quote Originally Posted by Zer0Cool View Post
    Can you please elaborate on what you have and what you want to accomplish? I looked at the sample and its not clear if this is the format you work with or the result you want to accomplish or both.

    Ideally, a sample file should:
    • Replicate the structure and types of data in your actual file
    • Illustrate what you have and what your goal is
    • Include any notes/comments that may help others understand the file

    It would also be helpful to describe things here as it relates to the sample file, IE:

    " I have a table for drivers in A1:B10 on Sheet1..."

    vs

    "I have a table of drivers and want..."

    In doing the above we can more easily follow your description and understand exactly what needs to be manipulated in the file.
    Ok. The first table (Vehicle Details) is A1:C8
    Second table (Links Driver to Vehicle) is A10:B17
    Third Table (Driver Details) is A19:F26

    The output result (a fourth table) should have the drivers details from the Third table, and populate the Vehicle details according to the vehicle allocated in the second table. When I open the document, I wish to allocate vehicles to drivers, and the Output result "Does the rest"

    Not the best at explaining, hopefully this makes sense.

    Thanks.

    Quintin

  13. #13
    Registered User
    Join Date
    06-20-2018
    Location
    KwaDukuza; South Africa
    MS-Off Ver
    Office 2016
    Posts
    11

    Re: Merging variables from two separate tables into a separate table

    Quote Originally Posted by Zer0Cool View Post
    Can you please elaborate on what you have and what you want to accomplish? I looked at the sample and its not clear if this is the format you work with or the result you want to accomplish or both.

    Ideally, a sample file should:
    • Replicate the structure and types of data in your actual file
    • Illustrate what you have and what your goal is
    • Include any notes/comments that may help others understand the file

    It would also be helpful to describe things here as it relates to the sample file, IE:

    " I have a table for drivers in A1:B10 on Sheet1..."

    vs

    "I have a table of drivers and want..."

    In doing the above we can more easily follow your description and understand exactly what needs to be manipulated in the file.
    I've named the First Table Vehicles
    The second table Link
    Third Table Drivers.

    I've also added an example of the desired outcome!
    Attached Files Attached Files

  14. #14
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Merging variables from two separate tables into a separate table

    Thanks for clarifying, a much better example and explanation.

    So looking at this it appears your link between all 3 tables is Surname and KZN Reg. Your second table basically defines the relationship between the vehicle and driver tables, correct?

    Is there any case of duplication? For example will all the surnames be unique? All the KZN Reg numbers be unique?

    If they are both unique this shouldnt be hard, but if 1/2 (Surname/KZN Reg) is repeated or if neither is unique it makes it much less simple.

    Presuming they are unique, Ill post a sample file updated with a method to do this soon.

  15. #15
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Merging variables from two separate tables into a separate table

    See attached.

    Its just 3 VLOOKUPS. We do a VLOOKUP on the Surname and pull the KZN Reg number from the link table (A10:B17), then use the resulting KZN Reg number as the 1st arguement of other VLOOKUPs to pull data from the Vehicles table (A1:C8).

    I have placed the results in H19:J26. The easiest method is to just append these formulas to your Drivers table (A19:F26) or copy/paste that table and add the formulas to it. I placed them next to it.
    Attached Files Attached Files

  16. #16
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Merging variables from two separate tables into a separate table

    you can do that very quickly using PowerQuery (aka Get&Transform built-in to Excel 2016 Pro)

  17. #17
    Registered User
    Join Date
    06-20-2018
    Location
    KwaDukuza; South Africa
    MS-Off Ver
    Office 2016
    Posts
    11

    Re: Merging variables from two separate tables into a separate table

    Quote Originally Posted by Zer0Cool View Post
    See attached.

    Its just 3 VLOOKUPS. We do a VLOOKUP on the Surname and pull the KZN Reg number from the link table (A10:B17), then use the resulting KZN Reg number as the 1st arguement of other VLOOKUPs to pull data from the Vehicles table (A1:C8).

    I have placed the results in H19:J26. The easiest method is to just append these formulas to your Drivers table (A19:F26) or copy/paste that table and add the formulas to it. I placed them next to it.
    Perfect. Thanks a million.

+ 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. Optimal table design for pivoting with two separate but equal variables
    By DGAlamo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-26-2016, 05:30 PM
  2. Replies: 3
    Last Post: 03-31-2015, 03:07 PM
  3. [SOLVED] Macro needed to Concatenate data in 2 separate tables of 2 separate sheets
    By 823 in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 02-08-2015, 02:02 PM
  4. Merging Data from Separate Tables
    By william. in forum Access Tables & Databases
    Replies: 2
    Last Post: 11-02-2012, 05:07 PM
  5. Merging Data from Separate Tables
    By william. in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-31-2012, 01:34 PM
  6. Transfer Data to separate tables based two variables (site and product)
    By yunesm in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2010, 09:47 PM
  7. Transfer Data to separate tables based two variables (date and site)
    By yunesm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-28-2009, 08:30 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