Finding duplicate results, returning different values

EdwardTLC

New Member
Joined
Apr 16, 2020
Messages
3
Office Version
  1. 2013
Platform
  1. Windows
So have been trying to figure out how to utilize VLOOKUP or some other formula that will allow me to search a column for a duplicate value and return a different column value than the original value. Confusing?

Specifically in the chart pic I have uploaded, cell B2 would have a formula that would take the value in C2, find it as a duplicate in Column C and return the value in column A.

In this instance, it would find the duplicate in C12 and return the value in A12 put it in cell B2.

Thank you for any help in advance :)

Ed
 

Attachments

  • Inventory Location.png
    Inventory Location.png
    17.2 KB · Views: 15

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Welcome to the MrExcel forum!

FYI, please try to use the XL2BB tool to show your sample worksheet. Look for the button in the reply box. It makes it so much easier for somebody here to copy and work with your sheet, rather than having to type in your data from a picture. I use it below. That could explain why you haven't had any replies yet.

That said, try this:

Book1
ABCD
1Loc1Loc2Part #Description
2S1AS2B24365Part A
3S1A 26Part B
4S1AS2B2456Part C
5S1B 345Part D
6S1BS3A45657Part E
7S1B 92187Part F
8S2AS3B356Part G
9S2A 7645Part H
10S2AS3C234Part I
11S2B 546Part J
12S2BS1A24365Part A
13S2BS1A2456Part C
14S3AS1B45657Part E
15S3BS2A356Part G
16S3CS2A234Part I
17
Sheet15
Cell Formulas
RangeFormula
B2:B16B2=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW($A$2:$A$20)/($C$2:$C$20=C2)/(ROW(C2)<>ROW($C$2:$C$20)),1)),"")
 
Upvote 0
Thank you so much. I didn't know about the functions here as I just joined. I am still having a little issue.

My spreadsheet is around 3000 lines so I thought I could just adapt, by changing all the formula values. I have attached a sample this time of the chart so you can see the breaks ad the challenges I am having. One of the things I didn't consider in the initial question was many of the part numbers are Alpha Numeric. Not sure if this makes a difference when using the 'Aggregate' function. I tried using just numeric part numbers and I still couldn't make the formula work so I thought I would upload a large, but small portion of the original doc below.

Inventory Location.xlsx
ABCD
1Company Inventory
2
3Loc1Loc2Part #Description
4S1AK916514Hot Dipped Steel Hinge
5S1AKP000828Swing Door Hinge Assy
6S1AK1999933.5" Alum Hinge Strap
7S1AK9461591Chain Snap Holdback
8S1AK916649Footman Loop, Door Holder
9S1AK940725Spring Loaded Safety Hook
10S1AK944282SS Hinge Butt
11S1AK916155Hinge Bushing
12S1AK911473SSteel Hinge Pin
13S1AK944336SS Nylock Nut
14S1AK180673853-1/2" Door Bumper Retainer
15S1AK916427White Plastic ABS Recessed Box
16S1AK916139Rubber Extrusion U-253 x 3-1/2"
17S1AK947565Folding Footstep/Handheld
18S1AGR82219015 Amp Circuit Breaker w/Bracket
19S1A2131098Bulkhead Handle Assy
20S1A3060111End Stop, 16RT
21S1A3130585BRACKET SHIM, 3/16"
22S1A3131133Lift Block
23S1A3131028Plastic Pipe Clamp Shim
24S1A3130409Log Strap Washer/Plate
25S1AGR4484030amp, 3-Prong Relay
26S1AAS125012V 5-PRONG RELAY W/O DIODE
27S1AGR60381SuperNova LED License Light
28S1A1XC2760 Minute Spring Wound Timer
29S1A44767390Timer Ivory Knob Kit
30S1AGS100Wall Plate/Gang Box Gasket
31S1A1LXW9Ivory Gang Box/Wall Plate
32S1A41700301Dock Bumper, 2 Hole, 3x6
33S1A454347Galvanized Wire Kit, W/Clamps
34S1A51310232pc Log Strap Conn w/hardware
35S1A2131113Connector Strap W/D-Ring
36S1A21311032" D-Ring Assy, Lift System
37S1A2130037Log Strap Assy E, 4'6"
38S1A6500598Hubodometer
39S1A6500608Hubodometer
40S1AK9461591Chain Snap Holdback
41
42
43Loc1Loc2Part #Description
44S1A1LXW9Ivory Gang Box/Wall Plate
45S1A61000284.5" Hubometer Bracket
46S1AS4461082010Meritor ABS ECU
47S1AS24691QuikAlign Pvt Bolt Kit
48S1A90030880Cab Air Spring
49S1A1S5006Cab Suspension Air Bag
50S1A32966601Cab Seat Air Bag
51S1AS227Height Control/Leveling Valve
52S1A1277901H8200 SLIDER PIN SPRING
53S1A3060006Side Wall Track Bracket
54S1APTL8001Rear LED Box Lamp W/Window
55S1ASP702107" Round Recess Pan
56S1ASP802104" Recess Pan
57
58
59Loc1Loc2Part #Description
60S1BGR44240Electronic Dome Lamp Switch
61S1BK918124104" ABS Female Soft Door Seal
62S1BK918123104" ABS Male Soft Door Seal
63S1BGDP45985D-Style Door Seal, P/Ft
64S1BTOD69718Panel Mounted Head Seal
65S1BTOD70131Side Seal, Dual Lip
66S1BTRUESEALTrueseal Door Seal
67S1BWHI7470Whiting Door Side Seal
68S1B43004Rear Door Refrig Bulb Seal
69S1BK916141Door Rubber, U-89
70S1B2131098Bulkhead Handle Assy
71S1BV21680Inner Door Seal
72S1BV1081680Inner Door Seal
73S1BK944282SS Hinge Butt
74S1B33550038Dual Durometer Door Gasket
75S1BNEC6346701CORNER SEAL, P/FT
76S1BNEC692777114' OUTER DOOR TRIM
77
78
79Loc1Loc2Part #Description
80S1C9380SWDUniversal Dome Lamp w/switch
81S1CGR553402 Stud Red/Amber Light
82S1CGR64931Par 36 Rubber Tractor and Utility Light
83S1CPTL8001Rear LED Box Lamp W/Window
84S1CGR53292SuperNova® LED S/T/T Light
85S1CTL44322R6-LED S/T/T Light w/Grey Flange
86S1CTL41202RSquare Sealed S/T/T Light, LH
87S1CSTL75ABAmber Mid Turn LED Light
88S1CDOTMR/S DOT Tape, 18", P/PC
89S1CMYLARMylar Tape, Roll
90S1CDSTAPEDouble Sided Mounting Tape
91S1C15PTAPE1.5" Blk Foam Tape, 50'
92S1CRTAPERoof Bow Tape, Roll
93S1C1PTAPE1" Panel Tape, Roll
94S1C8X300S300' Smooth Clr Vinyl Strip
95S1C12X150R150' Ribbed Clear Vinyl Strip
96S1C14PTAPE1/4" Panel Tape, 150'
97
98
99Loc1Loc2Part #Description
100S1DTL413" Red Refl W/Alum Mount
101S1DTL41A3" Amber Refl W/Alum Mount
102S1DTL522" Red Refl W/Hole Mount
103S1DTL52A2" Amber Refl W/Hole Mount
104S1DTL544X2 Red Oblong Refl W/Adhesive
105S1DTL54A4X2 Amber Oblong Refl W/Adhesive
106S1DTL98003Y4X1 Amber Refl W/Adhesive
107S1DTL98003R4X1 Red Refl W/Adhesive
108S1DTL98006Y3" Amber Refl W/Center Mount
109S1DTL98006R3" Red Refl W/Center Mount
110S1DTL21051RRed LED C/M Light w/Reflex Lens
111S1DTL44302R44-Led, 4" S/T/T Light
112S1DTL10202YAmber Selaed 2.5" C/M Light
113S1DTL10202RRed Selaed 2.5" C/M Light
114S1DGR1033Amber 2.5" LED C/M Light
115S1DGR1032Red 2.5" LED C/M Light
116S1DPT3000AAmber 2" Sealed Incand Light
117S1DPT3000RRed 2" Sealed Incand Light
118S1DTL30257Y2" Round Amber 'ABS' Light
119S1DTL104142.5" Light Bracket Kit
120S1DTL30404Plastic Mount W/Grom for 2" Lite
121S1DTL10202CClear Selaed 2.5" C/M Light
122S1DTL33204RRed 3/4" 1 LED Light, W/Grmt
123S1DTL33250YAMBER 3/4" LED RND C/M LIGHT
124S1DTL33250RRED 3/4" LED RND C/M LIGHT
125S1DGR53102Red 4" Incand S/T/T Sealed Light
126S1DTL60216Y6" Oval Amber Turn W/Flange
127S1DPT2601AAmber Oval Incand C/M Light
128S1DPT2601ALNAmber Oval Lens Cover
129S1DPT2601RRed Oval Incand C/M Light
130S1DPT2601RLNRed Oval Lens Cover
131S1DPT2602AAmber Double Bullseye C/M Light
132S1DPT2602ALNAmber Bullseye Lens
133S1DPT2602RRed Double Bullseye C/M Light
134S1DPT2602RLNRed Bullseye Lens
135S1DGR921632X6 Amber Reflex Repl Lens
136S1DGR921622X6 Red Reflex Repl Lens
137S1DGR91043Red Lens Cover, Reflexive
138S1DGR91042Red 2-Bulb Reflex Replacement Lens
139S1DGR90172Red Rect S/T/T Repl Lens
140
141
142Loc1Loc2Part #Description
143STORGR90173Amber Rect S/T/T Repl Lens
144STORTL15200R2" RED INCAD LIGHT
145STORTL15200Y2" AMBER INCAD LIGHT
146STORTL15200C2" WHITE INCAD TAG LIGHT
147STORTL15414Rail Mounting Bracket/Plug
148STORTL15412Rail Mounting Bracket w/cutout
149STORPT2602ALNAmber Bullseye Lens
150STORTL19031RRed LED Marker Light/Mnt Kit
151STORK944282SS Hinge Butt
152STORTL19200RRed Incand C/M Light
153STORTL19250YAmber 4" LED C/M Light
154STORTL19250RRed 4" LED C/M Light
155STORTL19350YAmber LED C/M Light
156STORTL19350RRed LED C/M Light
157STORA78CB16" Plastic Oval Chrome Ring
158STORTL19748Chrome Base Mount
159STORTL19200C4" WHITE SEALED UTILITY LIGHT
160STORTL19720Grey LED Light Mount
161STORTL10202RRed Selaed 2.5" C/M Light
162STORTL19721Flat Base Mount, Grey
163STORTL19738Curved Base Mount, Grey
164STORGR52063Aero Comb Marker/Side Turn Light
165STORGR54002Red SNova® TB II LED S/T/T Light
166STORTL21251YAMBR LED C/M LIGHT W/REFLEX LENS
167STORTL21251RRED LED C/M LIGHT W/REFLEX LENS
168STORTL21002RRed Rectangular Sealed Light
169STORTL21002YAmber Rectangular Sealed Light
170STORGR47073Amber 2" x 6" LED C/M Light
171STORGR47072Red 2" x 6" LED C/M Light
172STORGR46803Amber Incand Turtle II C/M Light
173STORGR46802Red Incand Turtle II C/M Light
174STORGR47163Amber SuperNova® LED Light
175STORGR47162Red SuperNova® LED Light
176STORGR43253SS Theft Resistant 4" Flange
177STORGR532524″ 10-Dio Red LED S/T/T Lamp
178STORGR47962Red MicroNova® LED C/M Light
179STORGR54233SuperNova® LED Side Turn Signal
180STORGR47963Amber MicroNova® LED C/M Light
181STORGR52533Amber 6" Oval Turn/Marker Lamp
182STORTL60275YLED Oval Turn Sig/Marker Lamp
Sheet1
 
Upvote 0
Thank you so much. I didn't know about the functions here as I just joined. I am still having a little issue.

No worries! We're all new sometimes. Kudos on figuring it out so quickly. Here's how you adapt that formula to the range you posted:

Book1
ABCD
1Company Inventory
2
3Loc1Loc2Part #Description
4S1A K916514Hot Dipped Steel Hinge
5S1A KP000828Swing Door Hinge Assy
6S1A K1999933.5" Alum Hinge Strap
7S1AS1AK9461591Chain Snap Holdback
8S1A K916649Footman Loop, Door Holder
9S1A K940725Spring Loaded Safety Hook
10S1AS1BK944282SS Hinge Butt
11S1A K916155Hinge Bushing
12S1A K911473SSteel Hinge Pin
13S1A K944336SS Nylock Nut
14S1A K180673853-1/2" Door Bumper Retainer
15S1A K916427White Plastic ABS Recessed Box
16S1A K916139Rubber Extrusion U-253 x 3-1/2"
17S1A K947565Folding Footstep/Handheld
18S1A GR82219015 Amp Circuit Breaker w/Bracket
19S1AS1B2131098Bulkhead Handle Assy
20S1A 3060111End Stop, 16RT
Sheet16
Cell Formulas
RangeFormula
B4:B20B4=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW($A$4:$A$200)/($C$4:$C$200=C4)/(ROW(C4)<>ROW($C$4:$C$200)),1)),"")


I didn't want to post the whole range again, there's a few in this sample that shows it working. It shouldn't matter if the values are numeric or alphanumeric, as long as they are the same.
 
Upvote 0
I figured out why it wasn't working the first time. I was using Google Sheets rather than Excel. (I have it saved both ways) Google sheets does not recognize the Aggregate formula.

Thank you so much for your help, you saved me having to Sort and resort values.

Ed
 
Upvote 0
It's a good idea to mention you're using Google Sheets. While Google Sheets and Excel are similar, there are significant differences, as you've seen. This formula might work in Google Sheets:

=ARRAYFORMULA(IFERROR(INDEX(A:A,SMALL(IF(($C$4:$C$200=C4)*(ROW(C4)<>ROW($C$4:$C$200)),ROW($A$4:$A$200)),1)),""))

but I have no way to test it.

I'm glad you got the Excel version working.
 
Upvote 0

Forum statistics

Threads
1,214,805
Messages
6,121,656
Members
449,045
Latest member
Marcus05

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