Using VLOOKUP in an If statement, but getting 0 as the answer?

ThePangloss

New Member
Joined
Jun 19, 2015
Messages
40
So I have a bunch of duplicates and uniques. I've marked all duplicates with numbers ranging from 1-10 depending on how many duplicates there are.

After this, on a different sheet to confirm which quantities are unique and which have duplicates I put

=IF(VLOOKUP(H2,Sheet2!$G$2:$O$100000,9,FALSE)="","unique","duplicate") where row 9 in sheet 2 contains blanks and these numbers from 1-10.

this returns a 0 for me. It works well if I don't include the $ anywhere, but when I include them I get 0's. I want it to search the whole array in the other sheet not just relatively to the H value given.

Any advice?
 
Last edited:

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Your formula will return the matched value from cell H2 to column O of Sheet2 not what's in row 9 :confused:

What is in column O of Sheet2?
 
Last edited:
Upvote 0
When the VLOOKUP returns from a null cell it will return zero, not "".
Your IF will always be FALSE, and return "duplicate"

Try
=IF(VLOOKUP(H2,Sheet2!$G$2:$O$100000,9,FALSE)>0,"duplicate","unique") or
=IF(VLOOKUP(H2,Sheet2!$G$2:$O$100000,9,FALSE)=0,"unique","duplicate")
 
Upvote 0

Forum statistics

Threads
1,214,981
Messages
6,122,565
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top