Creating a dynamic IF statement

R

Robert Robinson

I have data in two sheets. I want to create an IF statement in the second
sheet that has the ability to scan the first sheet for a value. If it finds a
match to a value in the second sheet, deposit the value into the
corresponding cells of sheet two. My example:

Sheet 1
User B 12/10
User C 12/15

Sheet 2
User A
User B

In this example, I will have the IF statement in column B of Sheet 2. I want
the IF statement to scan column A in sheet 1 for matches to column A of sheet
2. If it finds a match, place the corresponding value in column B (in this
case, it would find a match in User B and deposit 12/10 in column B of sheet
2. If it does not find a match, it leaves column B blank.

I can create a static IF link from sheet 2 to sheet 1; however, the
populations of sheets 2 and 1 are different. In addition, the populations of
sheets 2 and 1 will be ever changing, thus, I need to be able to create the
dynamic IF statements. Would I nest a VLOOKUP in the IF statement to get this
done, or is there another function that I should use?
 
L

Luke M

I think you can do something like this:

=IF(ISNA(MATCH(A2,'Sheet 1'!A:A,0)),"",VLOOKUP(A2,A:B,2,FALSE))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top