If, Lookup, Match or a combination of all

B

Beverly Darvill

Hi

I have 1 excel spreadsheet with several worksheets. What I need to do is to
take the value from 1 cell in one sheet look at a list of values on a second
sheet and return the value but only if there is an exact match else I need it
to return a 0. At the moment with Lookup it is returning a value that is the
closest match.

Sheet 1
Column A Column B Column C Column D Column J
sumtotal name title Code Value of Col B
from sheet 2

Sheet 2
Column A Column B
Code Value

I need it to look the value from column D in Sheet 1 and match it to the
Code in Column A on sheet 2 and return the value of Column B to Col J in
sheet 1 else return a 0

Thanks
 
L

Lars-Åke Aspelin

Hi

I have 1 excel spreadsheet with several worksheets. What I need to do is to
take the value from 1 cell in one sheet look at a list of values on a second
sheet and return the value but only if there is an exact match else I need it
to return a 0. At the moment with Lookup it is returning a value that is the
closest match.

Sheet 1
Column A Column B Column C Column D Column J
sumtotal name title Code Value of Col B
from sheet 2

Sheet 2
Column A Column B
Code Value

I need it to look the value from column D in Sheet 1 and match it to the
Code in Column A on sheet 2 and return the value of Column B to Col J in
sheet 1 else return a 0

Thanks


Try the following formula in Sheet1 cell J2:

=IF(ISERROR(VLOOKUP(D2,Sheet2!$A$1:$B$100,2,FALSE)),0,VLOOKUP(D2,Sheet2!$A$1:$B$100))

The 100 might have to be increased if you have more than 100 rows of
data in Sheet2

Hope this helps / Lars-Åke
 
B

Bob Phillips

=IF(NOT(ISNA(VLOOKUP(value,Sheet2!Lookup_Table,2,FALSE))),VLOOKUP(value,Sheet2!Lookup_Table,2,FALSE),"")
 
L

Lars-Åke Aspelin

Try the following formula in Sheet1 cell J2:

=IF(ISERROR(VLOOKUP(D2,Sheet2!$A$1:$B$100,2,FALSE)),0,VLOOKUP(D2,Sheet2!$A$1:$B$100))

The 100 might have to be increased if you have more than 100 rows of
data in Sheet2

Hope this helps / Lars-Åke

I forgot to explain that it is the FALSE that tells VLOOKUP to look
for an exact value.
 

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