Vlookup - look for unique values

Mike_Svk

New Member
Joined
Jan 24, 2025
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Dear community,

I am trying to resolve following challenge.

I have fill data from one table into another one. I am using Vlookup function but it only brings the first unique value.
I need to figure out how to bring first unique value as result A1 and secong unique value as result of A2

AB
MDRYSC2HU92SZ086172
MDRYSC2HU93SZ086164

Thank you for your help,
Mike
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
use unique() and filter()
whats the vlookup formula you are using

as you have 365 version use
Unique(filter(range of source, range of source for criteria =criteria) )
 
Upvote 0
Dear community,

I am trying to resolve following challenge.

I have fill data from one table into another one. I am using Vlookup function but it only brings the first unique value.
I need to figure out how to bring first unique value as result A1 and secong unique value as result of A2

AB
MDRYSC2HU92SZ086172
MDRYSC2HU93SZ086164

Thank you for your help,
Mike
Without detils of your tables, this demonstrates a technique that you can use.

=INDEX(UNIQUE(SORT(FILTER(tblData[Item],tblData[ID]=$E$2))),1)
The number at the end indicates which occurence to return.

Are you able to implement this technique?

Cell Formulas
RangeFormula
E3E3=INDEX(UNIQUE(SORT(FILTER(tblData[Item],tblData[ID]=E2))),1)
B4:B34B4=RANDBETWEEN(1,5)
C4:C34C4="Item " & RANDBETWEEN(1,5)
 
Upvote 0
Hi guys, thank you for your replies.

I guesss I have to clarify little bit more.

I have 2 worksheets.
In first worksheet I have orders from customers. Multiple customers can order idem under specific code - MDRYSC2H
In second worksheet I have produced units based on orders from first worksheet I need to allocate for customers
AB
MDRYSC2HU92SZ086172
MDRYSC2HU93SZ086164

In the end I need to allocated this
Customer 1 ordered MDRYSC2H and their order is now produced with uniqe value"U92SZ086172"
Customer 2 ordered MDRYSC2H (the same ordering code as customer 1) and their order is now produced with uniqe value"U93SZ086164"

I have 100s of orders and 1000s of produced units I have to allocate to customers.

Regards,
Mike
 
Upvote 1
sorry i'm not following as i dont know what you data layout is like
using a variation of the unique(filter as posted by myself and also by HighAndWilder may do what you are after

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
Hi Etaf,

understantood.

I will try to explain with the help of uploaded google spredsheet.
( mrexcel )

First excel worksheet contains customers and what their orders ("Orders from customers") . Every customer can order multiple material codes.
Second worksheet ("Production") contains material codes and finished goods serial number

What I need to do is to find "finished product serial number" from worksheet production and paste it into worksheet Orders from customers, into C column.

The catch is that one "material" will have multiple "finished product serial numbers". For ilustration pupposes I highlated one material code with blue and the same material code with yellow. As you can see they have different "Finished product serial number" values (B3 and B8)
 
Upvote 0
does this work
=IFERROR(INDEX(FILTER(Production!$B$3:$B$10,Production!$A$3:$A$10='Orders from customers'!B3),COUNTIF($B$3:B3,B3)),"not found")

mrexcel-etaf.xlsx
ABCDE
1Orders
2CustomerMaterialFinished product serial numberfilterFinished product serial number
31MDRYSC2HK14U90SZ0875324U90SZ087532
41MDRX1T01B14U93SZ0861644U96SZ087535
52MDRX1T01B13rd entry to test4U97SZ087253
62MFRPSD7H4F4U99SZ087254
73MDRYSD2HK14U92SZ086172
83MDRYSC2HK14U93SZ086164
94MFRPSG7H4F4U95SZ087820
104MFRPSD7H4Fremoved value to test errornot found
11MDRYSC2HK1added 3rd 3rd entry to test
Orders from customers
Cell Formulas
RangeFormula
D3:D5D3=TAKE(FILTER(Production!B3:B10,Production!A3:A10='Orders from customers'!B3),COUNTIF(Production!A3:A10,'Orders from customers'!B3))
E3:E11E3=IFERROR(INDEX(FILTER(Production!$B$3:$B$10,Production!$A$3:$A$10='Orders from customers'!B3),COUNTIF($B$3:B3,B3)),"not found")
Dynamic array formulas.


mrexcel-etaf.xlsx
AB
1Productions
2MaterialFinished product serial number
3MDRYSC2HK14U90SZ087532
4MDRX1T01B14U96SZ087535
5MDRX1T01B14U97SZ087253
6MFRPSD7H4F4U99SZ087254
7MDRYSD2HK14U92SZ086172
8MDRYSC2HK14U93SZ086164
9MFRPSG7H4F4U95SZ087820
10MDRYSC2HK13rd entry to test
Production


link to dropbox will only be available for a few days
 
Upvote 0
Solution

Forum statistics

Threads
1,226,050
Messages
6,188,571
Members
453,484
Latest member
jlo1673

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