I would like to lookup values between two data tables with a condition.
In the first table, I would like to create a new column "Return" and lookup the return for each identifier on a specified end date.
Desired output: lookup the return for all identifiers in Table 2 on the end date 28/02/2006.
Hope it is clear. Cheers!
Table 1:
Identifier |
---|
AA1 |
BX2 |
... |
Table 2:
Date (DD/MM/YYYY) | Identifier | Return |
---|---|---|
31/01/2006 | AA1 | -2.0 |
28/02/2006 | AA1 | 4.0 |
31/03/2006 | AA1 | 1.0 |
31/01/2006 | BX2 | 3.0 |
28/02/2006 | BX2 | -5.0 |
31/03/2006 | BX2 | -8.0 |
... | ... | ... |
Desired output
Identifier | Return 28/02/2006 |
---|---|
AA1 | 4.0 |
BX2 | -5.0 |
I have searched around for a solution but I have not found an idea how to solve the problem of specifying a condition.