Match a value but return a different column value without duplicates

aheffy

New Member
Joined
Aug 5, 2018
Messages
5
I'm working with a large amount of data in two separate tabs:

Tab X: Column A (Product #) contains a list of product numbers (e.g. 700, 701, etc). Column B (Load ID) contains a unique ID for one specific unit of that product (e.g. 12345, 12346, etc).

Tab Y: Column A (Product #) contains a list of product numbers again (e.g. 700, 701, etc). Column B (Order #) contains a list of customer orders (e.g. ST567, ST568).

I am trying to match the product numbers in tab X with the product numbers in tab Y and return a unique customer order number (column B) that relates to that product number. However, I can only use each order number once, I can't have duplicates. Put differently, I am attempting to pair unique ID's of various product numbers to unique order numbers of the same product without duplicates.

I've attempted various index and match formulae as well as various vlookup formulae with nested ifs. I don't believe I have gotten close with either of these. :(

Thank you in advance for any help you can provide!!!
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Can you provide a sample or screenshot with the desired result? We have to see how the layout of the data is.
 
Upvote 0
rUZMG9k

Sure! Sorry, I should I have done that from the beginning.


Can you provide a sample or screenshot with the desired result? We have to see how the layout of the data is.
 
Upvote 0
OK, I presume that the image is from Tab X and that the yellow area is where the formula is inserted. Is this a correct assumption?

When this is a Yes, where do we lookup the Order # in column C? I mean, are the Order # in a table on Tab Y? If Yes then please send screenshot from Tab Y.
 
Upvote 0
OK, I presume that the image is from Tab X and that the yellow area is where the formula is inserted. Is this a correct assumption?

When this is a Yes, where do we lookup the Order # in column C? I mean, are the Order # in a table on Tab Y? If Yes then please send screenshot from Tab Y.

Yes, your assumption is correct. The yellow area is where the formula will be inserted on Tab X.

Here is a screenshot of Tab Y:
hgA4LMG.jpg


Thank you for your help!
 
Upvote 0
Well, it's a difficult lookup because you got nothing to go on. You only have the Product# and there are duplicates as you mentioned.
The only thing I can think of is to insert a helper column in COLUMN E.

Formula's:

In C2:
Code:
=IFERROR(VLOOKUP($A2&"-"&COUNTIF($A$2:$A2;$A2);$E$2:$G$25;3;FALSE);"")
And copy down.

In E2 (the helper column):
Code:
=$F2&"-"&COUNTIF($F$2:F2;F2)
And copy down.

Row\Col
A​
B​
C​
D​
E​
F​
G​
1​
Product_NumberLoad_IDOrder_NumberHelperProduct_NumberOrder_Number
2​
703​
12345​
ST361709-1
709​
ST567
3​
708​
12346​
705-1
705​
ST568
4​
709​
12347​
ST567701-1
701​
ST329
5​
701​
12348​
ST329710-1
710​
ST210
6​
701​
12349​
ST853701-2
701​
ST853
7​
702​
12350​
ST490701-3
701​
ST580
8​
708​
12351​
707-1
707​
ST385
9​
700​
12352​
ST456702-1
702​
ST490
10​
702​
12353​
ST381704-1
704​
ST399
11​
704​
12354​
ST399704-2
704​
ST443
12​
700​
12355​
705-2
705​
ST274
13​
705​
12356​
ST568707-2
707​
ST494
14​
710​
12357​
ST210707-3
707​
ST482
15​
705​
12358​
ST274710-2
710​
ST242
16​
703​
12359​
ST407710-3
710​
ST416
17​
700​
12360​
709-2
709​
ST275
18​
710​
12361​
ST242704-3
704​
ST317
19​
703​
12362​
709-3
709​
ST240
20​
703​
12363​
703-1
703​
ST361
21​
707​
12364​
ST385710-4
710​
ST413
22​
710​
12365​
ST416707-4
707​
ST486
23​
700​
12366​
702-2
702​
ST381
24​
707​
12367​
ST494703-2
703​
ST407
25​
709​
12368​
ST275700-1
700​
ST456
26​
27​
Tab XTab Y

You have to adjust the formula's so that they refere to your sheetnames.
 
Upvote 0
Well, it's a difficult lookup because you got nothing to go on. You only have the Product# and there are duplicates as you mentioned.
The only thing I can think of is to insert a helper column in COLUMN E.

Formula's:

In C2:
Code:
=IFERROR(VLOOKUP($A2&"-"&COUNTIF($A$2:$A2;$A2);$E$2:$G$25;3;FALSE);"")
And copy down.

In E2 (the helper column):
Code:
=$F2&"-"&COUNTIF($F$2:F2;F2)
And copy down.

Row\Col
A​
B​
C​
D​
E​
F​
G​
1​
Product_NumberLoad_IDOrder_NumberHelperProduct_NumberOrder_Number
2​
703​
12345​
ST361709-1
709​
ST567
3​
708​
12346​
705-1
705​
ST568
4​
709​
12347​
ST567701-1
701​
ST329
5​
701​
12348​
ST329710-1
710​
ST210
6​
701​
12349​
ST853701-2
701​
ST853
7​
702​
12350​
ST490701-3
701​
ST580
8​
708​
12351​
707-1
707​
ST385
9​
700​
12352​
ST456702-1
702​
ST490
10​
702​
12353​
ST381704-1
704​
ST399
11​
704​
12354​
ST399704-2
704​
ST443
12​
700​
12355​
705-2
705​
ST274
13​
705​
12356​
ST568707-2
707​
ST494
14​
710​
12357​
ST210707-3
707​
ST482
15​
705​
12358​
ST274710-2
710​
ST242
16​
703​
12359​
ST407710-3
710​
ST416
17​
700​
12360​
709-2
709​
ST275
18​
710​
12361​
ST242704-3
704​
ST317
19​
703​
12362​
709-3
709​
ST240
20​
703​
12363​
703-1
703​
ST361
21​
707​
12364​
ST385710-4
710​
ST413
22​
710​
12365​
ST416707-4
707​
ST486
23​
700​
12366​
702-2
702​
ST381
24​
707​
12367​
ST494703-2
703​
ST407
25​
709​
12368​
ST275700-1
700​
ST456
26​
27​
Tab XTab Y

<tbody>
</tbody>


You have to adjust the formula's so that they refere to your sheetnames.

That did it! Thank you so much for your help. I should have thought of that, but I didn't and I don't think it was going to come to me overnight. Much appreciated!
 
Upvote 0

Forum statistics

Threads
1,214,619
Messages
6,120,550
Members
448,970
Latest member
kennimack

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