How to copy across the first unique value

skoorBmaS

New Member
Joined
Feb 5, 2016
Messages
34
I'm sure that this is already plenty of threads for this, but I'm not sure how to explain what I wish to achieve. Currently I have a list which has a description in. I want this referenced in another table, however I want all the descriptions which match to be grouped together. For example,

[TABLE="width: 100"]
<tbody>[TR]
[TD]Description[/TD]
[/TR]
[TR]
[TD]Cat[/TD]
[/TR]
[TR]
[TD]Cat[/TD]
[/TR]
[TR]
[TD]Cat[/TD]
[/TR]
[TR]
[TD]Dog[/TD]
[/TR]
</tbody>[/TABLE]

The formula I am currently using is =IF(A2=A3,"-", A2)

This works fine however it will place the word dog in the fourth cell, rather than the second cell which is what I wish to achieve. So the formula should take each unique value and enter them into neighboring cells (E1,F1,G1 etc.)

Hope this makes sense.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
I'm sure that this is already plenty of threads for this, but I'm not sure how to explain what I wish to achieve. Currently I have a list which has a description in. I want this referenced in another table, however I want all the descriptions which match to be grouped together. For example,

[TABLE="width: 100"]
<tbody>[TR]
[TD]Description[/TD]
[/TR]
[TR]
[TD]Cat[/TD]
[/TR]
[TR]
[TD]Cat[/TD]
[/TR]
[TR]
[TD]Cat[/TD]
[/TR]
[TR]
[TD]Dog[/TD]
[/TR]
</tbody>[/TABLE]

The formula I am currently using is =IF(A2=A3,"-", A2)

This works fine however it will place the word dog in the fourth cell, rather than the second cell which is what I wish to achieve. So the formula should take each unique value and enter them into neighboring cells (E1,F1,G1 etc.)

Hope this makes sense.

Something like this:

=IFERROR(INDEX($A$2:$A$5, MATCH(0, COUNTIF($C$1:C1, $A$2:$A$5), 0)),"")

It is an array so control + shift + enter and drag down

Ive entered this into C2 and assumed your data is from A2 to A5 so adjust as needed.
 
Last edited:
Upvote 0
Just noticed you were dragging right which would mean you would need to change the section in the countif. Redone to drag right it would be:

=IFERROR(INDEX($A$2:$A$5, MATCH(0, COUNTIF($B$2:B2, $A$2:$A$5), 0)),"")
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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