Combine two tables into one

appsboss7

New Member
Joined
May 1, 2020
Messages
2
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
Hi there,
I'm trying to combine 2 tables into 1.
The first table contains data about deliveries and the second contains data about serials.
I want to get a new table containing data from both tables, while joining the 2 tables by a column which both tables share called "orderCertificate".

* The Deliveries table contains many deliveries while each delivery has a unique orderCertificate, which can be attached to many records from the Serials.

An Example representing the 2 tables:
Deliveries:
Delivery1 | info about delivery1 | orderCertificate1
Delivery2 | info about delivery2 | orderCertificate2

Serials:
Item1 | info about item 1 | item1Serial | orderCertificate1
item2 | info about item 2 | item2Serial | orderCertificate1
item3 | info about item 3 | item3Serial | orderCertificate2


Is there any VBA function or a simple way to do that in excel?
I come from the SQL world and very rarely touched excel so if you could help me while explaining what I should change in order for things to work I will highly appreciate it!
Thanks in advance

{ If anyone has a solution for the problem in access it will also be great }
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
are these tables already in excel,

you could link to access or import into access and then "join" the two tables over the orderCertificate field and do a make table query
 
Upvote 0
are these tables already in excel,

you could link to access or import into access and then "join" the two tables over the orderCertificate field and do a make table query
I already tried that, but since only 1 record from the first table is linked to multiple records from the second table, a simple join wouldn't work.
 
Upvote 0
OK, in Excel then you can do a lookup
on the serials as they have multiple entries and in deliverys its only 1 per certificate

in Cell E2 of the Serials , and assuming the deliveries is on a deliveries sheet
=Index(A:A,Match(D2,$C:$C,0))
Copy into F2 and change to
=Index(B:B,Match(D2,$C:$C,0))

its years and years since i used Access to denormalise databases, extracting from SQL
But i remember doing that before OK in access, but been to long

Heres the example - in same sheet
Book2
ABCDEFGHIJKLMN
1Serials:Deliveries:
2Item1 info about item 1 item1Serial orderCertificate1Delivery1 info about delivery1 Delivery1 info about delivery1 orderCertificate1
3item2 info about item 2 item2Serial orderCertificate1Delivery1 info about delivery1 Delivery2 info about delivery2 orderCertificate2
4item3 info about item 3 item3Serial orderCertificate2Delivery2 info about delivery2
5
6
Sheet1
Cell Formulas
RangeFormula
E2:E4E2=INDEX(K:K,MATCH(D2,M:M,0))
F2:F4F2=INDEX(L:L,MATCH(D2,M:M,0))
 
Upvote 0

Forum statistics

Threads
1,214,965
Messages
6,122,499
Members
449,089
Latest member
Raviguru

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top