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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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