Return value

D

DebP

I am working on a sheet with the following:

Sheet 1 Col A = Description
Sheet 1 Col B = ID
Sheet 1 Col C = Returned value from Sheet 2 Col B when value in Sheet 1
Col B matches value in Sheet 2 Col A

I would like to take a cell from Sheet 1 Col B and find the matching
value in Sheet 2 Col A and fill in Sheet 1 Col C with associated value
from Sheet 2 Col B.

I know this is a simple lookup but I can't get it to work.
 
B

Biff

Thanks for the help, but I tried your suggestion and nothing happened.

Ok, let's examine what that means!
=IF(COUNTIF(B1,Sheet2!A:A),VLOOKUP(B1,Sheet2!A:B,2,0),"")

I take it that "nothing happened" means the formula returned a blank which
is what the "" is for.

So, if the formula returned a blank that means this portion:

COUNTIF(B1,Sheet2!A:A)

evaluated to zero which means that there is no match of B1 on Sheet2 in
column A.

If you can see for "certain" that there is in fact a match try this:

Find the matching cell on Sheet2 of column A. Assume that cell is A40.

Enter this formula in some empty cell:

=Sheet1!B1=Sheet2!A40

If they are in fact matches that formula will return TRUE and the lookup
formula should have returned the appropriate corresponding value. If the
formula returns FALSE then they are not matches. They may look the same but
can still not be matches. One value may have leading or trailing spaces that
you can't see. One value may be a TEXT number and the other may be a NUMERIC
number.

Biff
 
B

Biff

Ooops!

I committed a major blunder! I'm downright embarrassed!

=IF(COUNTIF(B1,Sheet2!A:A),VLOOKUP(B1,Sheet2!A:B,2,0),"")

I have the arguments backwards in the Countif function!!!!!!! <ouch>

Should be:

=IF(COUNTIF(Sheet2!A:A,B1),VLOOKUP(B1,Sheet2!A:B,2,0),"")

Biff
 

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