My table on sheet 1 has an ID number and a unique username associated for each number.
| ID Number |
Username |
| 1 |
kitty |
| 2 |
puppy |
My table on sheet 2 is a list of spending, with columns ID Number, Full Name, and Expenditure. I want to add in their username as a new column.
| ID Number |
Name |
Username (new column) |
Expenditure |
| 1 |
Dan |
|
20 |
| 1 |
Dan |
|
30 |
| 2 |
Molly |
|
16 |
| 1 |
Dan |
|
28 |
| 2 |
Molly |
|
21 |
I need Excel to insert the username from table 1 into the Username column on table 2, if the ID number is the same. At the moment I'm using the FILTER function as such, however, it seems overly complicated:
=FILTER('Sheet1'!B:B, 'Sheet2'!A2='Sheet1'!A:A)
I tried to use the IF function, however, the expenditure table has more rows than the username table, as there are repeated spendings of individuals.
=IF('Sheet2'A2='Sheet1'!A2, 'Sheet1'!B2)
Is there a simpler way to insert values from another table, dependent on the previous columns number?