Ignore Duplicate Values in a VLOOKUP formula

Craig Peter DG

New Member
Joined
Sep 10, 2016
Messages
19
Office Version
  1. 2013
Hi folks
In my table array I have quite a few duplicate item numbers in Column A. I need them to stay in there as i have referenced the duplicates in other function outputs. However, for one of my function outputs i actually want to IGNORE those duplicate values and only give me a result based on each UNIQUE item number. Anyone suggest a modification to the VLOOKUP function I would use please? Or is not a VLOOKUP i need at all?
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Toadstool

Well-known Member
Joined
Mar 5, 2018
Messages
1,439
Office Version
  1. 2016
Platform
  1. Windows
Hi Craig Peter DG,

You could check first with COUNTIF

Craig Peter DG.xlsx
ABCDEF
1ItemDataItems to Search
2X20DogX80Badger
3X30CatX70Cow
4X40MoleX60Sheep
5X40GoatX40 
6X60SheepX30 
7X70CowX20Dog
8X80BadgerX120Hedgehog
9X40GoatX100Pig
10X100Pig
11X40Goat
12X120Hedgehog
13X30Cat
Sheet1
Cell Formulas
RangeFormula
F2:F9F2=IF(COUNTIF($A$2:$A$13,E2)>1,"",VLOOKUP(E2,$A$2:$B$13,2,0))
 
Solution

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,547
Office Version
  1. 365
Platform
  1. Windows
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Another option, depending on version
+Fluff 1.xlsm
ABCDEF
1ItemDataItems to Search
2X20DogX20Dog
3X30CatX60Sheep
4X40MoleX70Cow
5X40GoatX80Badger
6X60SheepX100Pig
7X70CowX120Hedgehog
8X80Badger
9X40Goat
10X100Pig
11X40Goat
12X120Hedgehog
13X30Cat
Results
Cell Formulas
RangeFormula
E2:E7E2=UNIQUE(A2:A13,,1)
F2:F7F2=VLOOKUP(E2#,A2:B13,2,0)
Dynamic array formulas.
 

Craig Peter DG

New Member
Joined
Sep 10, 2016
Messages
19
Office Version
  1. 2013
Hi Craig Peter DG,

You could check first with COUNTIF

Craig Peter DG.xlsx
ABCDEF
1ItemDataItems to Search
2X20DogX80Badger
3X30CatX70Cow
4X40MoleX60Sheep
5X40GoatX40 
6X60SheepX30 
7X70CowX20Dog
8X80BadgerX120Hedgehog
9X40GoatX100Pig
10X100Pig
11X40Goat
12X120Hedgehog
13X30Cat
Sheet1
Cell Formulas
RangeFormula
F2:F9F2=IF(COUNTIF($A$2:$A$13,E2)>1,"",VLOOKUP(E2,$A$2:$B$13,2,0))
thanks
 

Watch MrExcel Video

Forum statistics

Threads
1,129,530
Messages
5,636,857
Members
416,945
Latest member
Himu

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
Top