Jul-06-2022, 02:40 PM
I want to compare three common columns(ID) in three different dataframes(USA, Canada, Mexico) and output if an ID matches in at least two data frames. How can I accomplish this?
So here is some sample data.
Below are the mockup spreadsheets
USA
| ID | COl A |
| -------- | ------- |
| 42345 | Test1 |
| 681593 | Test2 |
| 331574 | Test3 |
| 15786 | Test4 |
Mexico
| ID | COl A |
| -------- | ------- |
| 93512 | Chk1 |
| 681593 | Chk2 |
| 331574 | Chk3 |
| 89153 | Chk4 |
Canada
| ID | COl A |
| -------- | ------- |
| 42345 | Val1 |
| 93512 | Val2 |
| 331574 | Val3 |
| 76543 | Val4 |
Result Table
I want to print an "x" in the Result spreadsheet if more than one country has an ID match.
| ID | USA | Mexico | CANADA|
| -------- | ------- | ------- | ------- |
| 42345 | x | | x |
| 93512 | | x | x |
| 331574 | x | x | x |
| 681593 | x | x | |
So here is some sample data.
Below are the mockup spreadsheets
USA
| ID | COl A |
| -------- | ------- |
| 42345 | Test1 |
| 681593 | Test2 |
| 331574 | Test3 |
| 15786 | Test4 |
Mexico
| ID | COl A |
| -------- | ------- |
| 93512 | Chk1 |
| 681593 | Chk2 |
| 331574 | Chk3 |
| 89153 | Chk4 |
Canada
| ID | COl A |
| -------- | ------- |
| 42345 | Val1 |
| 93512 | Val2 |
| 331574 | Val3 |
| 76543 | Val4 |
Result Table
I want to print an "x" in the Result spreadsheet if more than one country has an ID match.
| ID | USA | Mexico | CANADA|
| -------- | ------- | ------- | ------- |
| 42345 | x | | x |
| 93512 | | x | x |
| 331574 | x | x | x |
| 681593 | x | x | |