Extract multiple matches which are unique into separate columns

cr9kus

New Member
Joined
Jun 30, 2022
Messages
4
Office Version
  1. 2019
Platform
  1. Windows
I have a following table.

NameValue
X10
Y20
Z30
X40
Y50
Z60
X10
Y60

I wish to extract all the unique values corresponding to the name in separate columns. The output shall come out like this. Since X has 10 as a value twice, I want it to be considered only once.

NameValue 1Value 2Value 3
X1040
Y205060
Z3060

Array Formula Used
=IFERROR(INDEX($B:$B,SMALL(IF($A:$A=$E2,ROW($B:$B)-MIN(ROW($B:$B))+1),COLUMNS($E$2:E2))),"")
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Welcome to the MrExcel forum!

Try:

Book3
ABCDEFG
1NameValueNameValue 1Value 2Value 3
2X10X1040
3Y20Y205060
4Z30Z3060
5X40
6Y50
7Z60
8X10
9Y60
10
Sheet26
Cell Formulas
RangeFormula
D2:D4D2=LET(u,SORT(UNIQUE(A2:A20)),FILTER(u,u<>""))
E2:F2,E4:F4,E3:G3E2=TRANSPOSE(UNIQUE(FILTER($B$2:$B$20,$A$2:$A$20=D2)))
Dynamic array formulas.
 
Upvote 0
thank you for your solution. Can this be done without using the newer formula as it might not work if used in older versions. Is there any way you can advise which can be used in office 19.
 
Upvote 0
Welcome to the MrExcel forum!

Try:

Book3
ABCDEFG
1NameValueNameValue 1Value 2Value 3
2X10X1040
3Y20Y205060
4Z30Z3060
5X40
6Y50
7Z60
8X10
9Y60
10
Sheet26
Cell Formulas
RangeFormula
D2:D4D2=LET(u,SORT(UNIQUE(A2:A20)),FILTER(u,u<>""))
E2:F2,E4:F4,E3:G3E2=TRANSPOSE(UNIQUE(FILTER($B$2:$B$20,$A$2:$A$20=D2)))
Dynamic array formulas.
thank you for your solution. Can this be done without using the newer formula as it might not work if used in older versions. Is there any way you can advise which can be used in office 19.
 
Upvote 0
If you have a special request that the solution be usable in earlier versions of Excel, please let us know in the original post, so we don't have to solve the problem twice. Try:

Book3
ABCDEFGH
1NameValueNameValue 1Value 2Value 3
2X10X1040  
3Y20Y205060 
4Z30Z3060  
5X40 
6Y50 
7Z60 
8X10
9Y60
10
Sheet26
Cell Formulas
RangeFormula
E2:H4E2=IFERROR(INDEX($B:$B,AGGREGATE(15,6,ROW($B$2:$B$20)/($A$2:$A$20=$D2)/(COUNTIF($D2:D2,$B$2:$B$20)=0),1)),"")
D2:D7D2=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW($A$2:$A$20)/($A$2:$A$20<>"")/(COUNTIF($D$1:$D1,$A$2:$A$20)=0),1)),"")


This should work in Excel 2010 and newer.
 
Upvote 0
Solution
If you have a special request that the solution be usable in earlier versions of Excel, please let us know in the original post, so we don't have to solve the problem twice. Try:

Book3
ABCDEFGH
1NameValueNameValue 1Value 2Value 3
2X10X1040  
3Y20Y205060 
4Z30Z3060  
5X40 
6Y50 
7Z60 
8X10
9Y60
10
Sheet26
Cell Formulas
RangeFormula
E2:H4E2=IFERROR(INDEX($B:$B,AGGREGATE(15,6,ROW($B$2:$B$20)/($A$2:$A$20=$D2)/(COUNTIF($D2:D2,$B$2:$B$20)=0),1)),"")
D2:D7D2=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW($A$2:$A$20)/($A$2:$A$20<>"")/(COUNTIF($D$1:$D1,$A$2:$A$20)=0),1)),"")


This should work in Excel 2010 and new

Sorry, I should have specified in the first go. Thank you for your solution.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,184
Members
452,615
Latest member
bogeys2birdies

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