Finding values

  • Thread starter Thread starter jonas.ornborg
  • Start date Start date
J

jonas.ornborg

Hello,
I would like to write a worksheet function which compare the contents
in two
cell from a database1 with the contents in two columne in database2.
Whenever there is a match I would like it to return a a prespecified
text
(i.e Yes or No) and a value from database2 associated with the found
match in different cells of database1.

Empty cells in database1 (in one or both the cells where comparasions
values
are found) also needs to be considered as no comparasion should be made
(i.e.
do not return the text Yes/No for the first match with any empty cell
in
database2).

Anyone that has suggestions?

Kind regards
Jonas
 
Jonas,

For the first part, something along the lines of

=IF(A2="","",IF(ISERROR(MATCH(CellwithValue to Match,DataBase2Column,False)),"No","Yes"))

like:

=IF(A2="","",IF(ISERROR(MATCH(A2,Sheet2!$A$1:$A$1000,FALSE)),"No","Yes"))

For the second part:

=IF(A2="","",IF(ISERROR(MATCH(A2,Sheet2!$A$1:$A$10000,FALSE)),"",INDEX(Sheet2!$B$1:$B$1000,MATCH(A2,Sheet2!$A$1:$A$1000,FALSE))))

HTH,
Bernie
MS Excel MVP
 

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

Back
Top