Anglais428v2
New Member
- Joined
- Jun 19, 2020
- Messages
- 27
- Office Version
- 365
- Platform
- Windows
I have two tables see below:
Table1:
Then Table2 (including expected result):
I need a formula to calculate the results 'Germany' and 'US' in Table2. The formula should look at the Country name in Table 2 (e.g. UK), go to Table1 and search for that country in the 'To' column, then return the 'from' country that has the highest number of results (in this case it would be 'Germany' as it occurs twice when the 'UK' is in the To column. Similarly for 'France' in the To column of Table 2, the result should be the US as it occurs three times in the From column of Table1.
Thanks
Table1:
To | From |
UK | Germany |
UK | US |
UK | Germany |
UK | France |
France | US |
France | US |
France | US |
France | Germany |
France | Germany |
Then Table2 (including expected result):
Country | Top 'from' |
UK | Germany |
France | US |
I need a formula to calculate the results 'Germany' and 'US' in Table2. The formula should look at the Country name in Table 2 (e.g. UK), go to Table1 and search for that country in the 'To' column, then return the 'from' country that has the highest number of results (in this case it would be 'Germany' as it occurs twice when the 'UK' is in the To column. Similarly for 'France' in the To column of Table 2, the result should be the US as it occurs three times in the From column of Table1.
Thanks