Creating a list of unique values based on 5 variables.

TheHighlandCal

New Member
Joined
Nov 12, 2018
Messages
1
Hi all,

Looking for some help on this problem.

I have 5 different columns with different measurements (these can be anything) and want to create a list of all the different unique combinations and then count how many of each unique combination there is.
There can be thousands of different entries so I am looking to completely automate this. The Table will look something like this:

Measurement 1Measurement 2Measurement 3Measurement 4Measurement 5Type
P01abcdeType A
P02abcde'Type B
P03abcdeType A

<tbody>
</tbody>

Once I achieve this counting the different types will be simple.
I hope this is clear and any help given will be greatly appreciated! :)
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hello,

You haven't said how you want this to be solved, but have a VBA solution

Code:
Sub COUNT_UNIQUE()
    For MY_ROWS = 2 To Range("A" & Rows.Count).End(xlUp).Row
        Range("J" & MY_ROWS).Value = Range("B" & MY_ROWS).Value & Range("C" & MY_ROWS).Value _
            & Range("D" & MY_ROWS).Value & Range("E" & MY_ROWS).Value & Range("F" & MY_ROWS).Value
    Next MY_ROWS
    Range("J1").Value = "Type"
    Range("J1:J" & Range("A" & Rows.Count).End(xlUp).Row).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range("H1" _
        ), Unique:=True
    Range("I1").Value = "Count"
    Range("I2").Formula = "=countif($J$2:$J$" & Range("J" & Rows.Count).End(xlUp).Row & ",H2)"
    Range("I2").Copy Range("I3:I" & Range("H" & Rows.Count).End(xlUp).Row)
End Sub

You haven't specified the exact way of displaying the results, but have assumed columns H, I and J are available.

Most of this can be achieved by formula.

How close is this to your requirements?
 
Upvote 0

Forum statistics

Threads
1,215,307
Messages
6,124,168
Members
449,146
Latest member
el_gazar

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