Lookup unique value in column of duplicates; return result based on value adjacent column.

EdBexson

New Member
Joined
Feb 27, 2015
Messages
1
Hi all,

New to the forum, so please forgive any newbie mistakes.

I have a list of 40,000 unique part numbers, and a seperate database of 500,000 part numbers.

The database has many duplicate part numbers, split by Plant (Ownership). The Part/Plant combination on each row is unique, and other columns in that row contain unique information, i.e. Demand and Sales.


To illustrate the database:

Part No
Plant (Owner)
Demand Value
Sales
1
A
£10,986
£9,401
2
B
£8,098
£4,871
3
A
£27,856
£33,401
2
C
£50,605
£11,398
2
A
£7,096
£7,984
4
B
£46,873
£56,012

<tbody>
</tbody>












What I would like to do is use my list of parts, and look them up against the database. However - as their are duplicate part numbers (see above), I would like to return only rows beloning to Plant B; BUT if Plant B does not exist for that part number, I would like it to return Plant A, and so on. I'd like this like a normal VLOOKUP, so I can return values further along the row, such as Demand Value and Sales.

Basically, I want a priority lookup, returning values based on a hierarchy of plants.

I would also like these to be interchangable, i.e.

IMPORTANCE
PLANT
1
B
2
A
3
C

<tbody>
</tbody>


Thanks,
Ed
 
Last edited:

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
You can do this in a single cell with a nested IF using INDEX and MATCH based on the cells in your Importance/Plant table. If there are lots of plant types (tens or hundreds) this will be a nightmare so this might not be a reasonable solution, but if there are 3 as in your example it is workable. Alternatively you can do this in one cell per plant type, i.e. your second table of Importance/Plant would have a third column that would return the value for the combination of Plant and Part - this would be pretty trivial using SUMIFS() on the Plant and Part.

Do either of these sound suitable? As an example of the SUMIFS method, for your first table being on the 'Data' sheet and your second table being on the 'Importance' sheet, with the part number you want to check being in a field called 'PartNo':

Demand value =sumifs(Data!C:C, Data!A:A, PartNo, Data!B:B, Importance!B2)
Sales =sumifs(Data!D:D, Data!A:A, PartNo, Data!B:B, Importance!B2)
 
Upvote 0

Forum statistics

Threads
1,215,516
Messages
6,125,286
Members
449,218
Latest member
Excel Master

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