unique values

Lukas C

New Member
Joined
Nov 9, 2016
Messages
24
Hi I'm heaving a small problem here
my table looks like that
1 2 3 4 5

A X X Y Y Z

B 12 21 10 10 10

I want to have unique numbers by letters in Raw C and D (like below) or in any other format

C X X Y Z

D 12 21 10 10

many thx in advance
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Code:
Sub v()
Dim rng As Range, cel As Range
Set rng = Range([B2], Cells(2, Columns.Count).End(xlToLeft))
rng.Resize(2).Copy [B4]
For Each cel In rng.Offset(2, 1)
    If cel & cel(2) = cel(1, 0) & cel(2, 0) Then cel.Resize(2).ClearContents
Next
End Sub
 
Upvote 0
Here is an array formula you could try.
Enter formulas in C1 and D1 with CTRL-SHIFT-ENTER then drag formulas down rows as needed.
Excel Workbook
ABCD
1X12X12
2X21X21
3Y10Y10
4Y10Z10
5Z10
Sheet
 
Upvote 0
You're welcome. Glad we could help. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,996
Messages
6,175,851
Members
452,675
Latest member
duongtruc1610

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