Use Relate() Function

flaxman64

New Member
Joined
Mar 5, 2015
Messages
2
Hi,

I have 2 tables that are related. One table has all data available for all post entered in the database. The other table has some of the post, but not everyone.

I want to get some data (one Colum) from the second table to the first. As I said they are related and I thought the Relate() function should work.

The problem I get is that there are about 800 values in the second table with a specific value. When I use the relate function to the first table I count the specific values and there are 340 more values than the original table (1140)

I thought that the rows that did not have any value because there where not present in the second table should be blank in the first table. For some reason I have more values?

I have been struggling with this issue for some days now and thought I ask somebody that knows! I hope this makes sense......

Mats
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I am kinda wondering if the direction of your relationship is correct? Sounds like you might have a 1:1 relationship (typically you have a 1:many) and might have the direction reversed, but... just a guess. hard to say w/o seeing more of the model.
 
Upvote 0
Hi,

Thanks for you answer. I have been investigated some more. Even though there are no doubles in any of the tables ID field I noticed that when working with the data some data that was for as an example 2012 was present when filtering data on only the year 2013. Strange I thought!
In regards to your answer I turned my focus on the relation. I tested some and added the year to the "file Number" that is the unique ID field, "File number - Year" (12345-2014). Then I used this for the relation and then everything worked as it should. The values from the table with not all fields available only imported the correct values and the count on row was correct.

I don't know why it was not possible to perform the relation on the ID filed alone without the year part.

Maybe there is an obvious reason that I'm not aware of. If anybody has a theory please let me know.
 
Upvote 0

Forum statistics

Threads
1,224,079
Messages
6,176,245
Members
452,716
Latest member
Elo

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