Vlookup and IF

  • Thread starter Thread starter Russell
  • Start date Start date
R

Russell

Hello,

Is it possible that someone could help me with a really big problem I
have? please please??

Right I have a massive spreadsheet, I basically need to do a VLOOKUP
on a cell but the cell im looking for there is more than 1 so I need
it to tell me there is a duplicate, only way i can think of is by
putting a IF function in-between there but i don't know how, does
this make sense??? I will elaborate if I can get and positive
feedback!
thanks so much.
 
Using COUNTIF will tell you:

=COUNTIF(J:J,A1)>1

So if there are duplicates, what do you want to do?

=IF(COUNTIF(J:J,A1)>1,do_something_here,VLOOKUP(---))

HTH
Jason
Atlanta, GA
 
If I understand you correctly:

You can use an IF function:

=IF(COUNTIF(A1:A1000,J1)>1,"duplicate",VLOOKUP(J1,A1:B1000,2,FALSE))

or, if you want to see the VLOOKUP value, but want to be notified that
there are duplicates,

=VLOOKUP(J1,A1:B1000,2,FALSE) & IF(COUNTIF(A1:A1000,J1)>1, "
(duplicates)", "")


Note that this returns text. If you need to return numbers, you might
use Conditional Formatting:

Format/Conditional Formatting...

CF1: Formula is =COUNTIF($A$1:$A$1000,J1)>1


and choose a font or background color to indicate that duplicates exist.
 
Back
Top