# Create Distinct Unique List For 2 Columns

Aug 6, 2014

So far I created code that creates a Distinct Unique item's list for one column. It works as it should but I want to modify the code to create a Distinct Unique item's list for two columns that are related to another i.e. a person's name to their license #.

Here is the code below that works for one column only:

[Code] ......

## Extract Unique Distinct List From Two Columns With Array Formula And Sort From A To Z

May 30, 2014

I have two lists in different columns, which are defined ranges. I want to extract them to a unique list with an array formula and at the same time sort albafetically, without duplicates, like this:

List1
List2

Final List

Audi
Ford

[Code] ....

So far, I have this formula which is working in what concerns removing duplicates and exctract a unique list. But it is not ordering alfabeticaly.

{=IFERROR(IFERROR(INDEX(List1, MATCH(0, COUNTIF(\$D\$1:D1, List1), 0)), INDEX(List2, MATCH(0, COUNTIF(\$D\$1:D1, List2), 0))), "")}

## Create Distinct List And Sort Alphabetically?

Jul 16, 2013

I am trying to create an alphabetised unique list for a report from an Excel master file and have searched the internet for solutions which all only seem to half work for me. I've copied a couple of array formulae below to try what I'm after and what the results are. 'RefSource' is the name I've given to the column of data I'm trying to sort.

{=INDEX(RefSource, MATCH(0, COUNTIF(\$A\$2:A2, RefSource),0))}

This one works when I copy the formula down and gives me the unique list but doesn't sort the it into alphabetical order.

{=INDEX(RefSource, MATCH(MIN(IF(COUNTIF(\$P\$1:P1, List)=0, 1, MAX((COUNTIF(RefSource, "

## Create List Of Unique Entries Based On Several Columns

Jul 27, 2013

[URL] ......

In that file, you can see there is a list of somewhat similar data across 5 columns. Some of the entries are duplicates, some are different by only one character. What I want to be able to do is generate a list of all the unique rows of data, taking into account the data from ALL 5 columns. The list can be on another sheet or simply just further down on the same sheet, that doesn't matter too much.

I could do it if it were just one column of data, but struggling trying to do it with several columns.

## Create 1 List Of Unique Values From 12 Columns Of Data

Apr 28, 2014

I have a spreadsheet of 12 columns (A to L), with a list of student names under each down to row 31. Each column represents an after-school club that the child can attend.

However, a child can sign up to multiple clubs, so their name can appear in several places across the spreadsheet.

What I would like to do is have a 13th column which is an overall list of students who have signed up to at least 1 club, i.e. their name appears at least once in columns A to L.

How do I achieve this so that only unique entries are listed and duplicates are removed in this 13th column?

## Create Unique List From Matrix & List Frequency Of Each Occurrence

May 23, 2009

I've searched the forum and believe this thread to be the closest to what im looking for, but its doesnt completely apply: matrix to list conversion. I have an attachment to support my questions (see attached). I have a matrix of words (strings) that contain repeating and non-repeating contents. The matrix also has spaces which are of no value. Essentially, the VBA needs to ' analyze' this matrix and create a consolidated frequency list (as shown in the file).

The matrices are HUGE and therefore some of the clumsy VBA i am using is turning out to be a bit inefficient. The file also contains formulas and such that I cannot use AutoFilter nor can I use Insert or Delete rows...so the VBA shouldnt use those either.

## Counting Unique / Distinct Occurrences With Wildcard

Aug 5, 2014

I'm working with a set of text values. The sets of text can be either 2 or 3 chars long (in this example 2), and are separated with a pipe. The end char for each set of chars in fixed. In this case a Z.

I'm looking for a formula which counts the unique / distict number of sets of chars. I have been trying to use COUNTIF with a wildcard (?Z), but unfortunately I haven't been able to find the correct formula yet.

For example.

|AZ|AZ|AZ|BZ|AZ|AZ|BZ|AZ|BZ|AZ| -> 2 (AZ, BZ)
|AZ|AZ|AZ|BZ|CZ|AZ|CZ|AZ|BZ|AZ| -> 3 (AZ, BZ, CZ)
|CZ|BZ|AZ|BZ|CZ|AZ|EZ|AZ|FZ|AZ| -> 5 (AZ, BZ, CZ, EZ, FZ)
|BZ|BZ|AZ|BZ|CZ|AZ|EZ|AZ|GZ|AZ| -> 5 (AZ, BZ, CZ, EZ, GZ)

## Create Unique List From List With Duplicates

Nov 28, 2007

I have a list of data which looks like this

Column B

Name
---------
Jones, Bob
Jones, Bob
Jones, Bob
Smith, Mike
Smith, Mike
Smith, Mike
Calai, Dave
Calai, Dave
Calai, Dave
Etc...

What I want to do is take the entire list and create a distinct list that I can use in a named range then use a validation list to have a drop down within a different tab.

## Create Unique List

Jun 20, 2008

I have a list of references and I need to pull from a database. The database contains more than one row with my reference, so I try doing something like this:

Sub ()
Range("B11").Select

Do Until IsEmpty(ActiveCell())
If ActiveCell = _
"7501" Or _
"7507" Or _
"7508" Or _
"7509" Or _
"7618" Then

But it does not work, besides I need to add more references. Could some one know a better way to do this?

## Sumproduct (count The Number Of Unique, Or Distinct, Company Names In Column)

Jan 28, 2010

I want to count the number of unique, or distinct, company names in column [C7], subject to two conditions that will exclude certain unique company names from the count.

I should also point out that most company names appear multiple times in column [C7].

a) Count the unique company names in column [C7]...

b) ...including only those companies who have at least one "Yes" in column [C8] somewhere among their records

c) ...and who also have at least one value equal or greater than "1" in column [C15] somewhere among their records

Note that that there is no requirement that the "Yes" and the "1" ever appear in the same record.

## Auto-populate Combobox - Extracts Unique Distinct Values From Column

Jan 11, 2013

The code below extracts unique distinct values from column A, except cell A1. Then the code adds the extracted unique distinct values to the combo box.

Sub FilterUniqueData()
Dim Lrow As Long, test As New Collection
Dim Value As Variant, temp() As Variant
ReDim temp(0)
On Error Resume Next
With Worksheets("Sheet1")

[Code]....

The vba code below copies the selected value to cell C5 whenever the combobox is selected

Copy the code into a standard module.Assign this macro to the combobox

Sub SelectedValue()
With Worksheets("Sheet1").Shapes("Drop Down 1").ControlFormat Worksheets("Sheet1").Range("C5") = .List(.Value)
End With
End Sub

Vba code belows instanly refresh the combobox when values are added/edited or removed from column A,

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("\$A:\$A")) Is Nothing Then
Call FilterUniqueData
End If
End Sub

My problem is this:

Everything will be working fine if the all combobox and data can be found in 1 sheet, but how could i make some tweaks if the combo box is located in sheet 2 provided your data to be populated is in sheet 1, i tried everything but the combobox doesnt update,

## Create Unique List From Data

Feb 11, 2014

I have some raw data of employment records on one workbook and from this i need to autopopulate there information into another workbook.

I need to split the records up by the different departments they work . I.e so what i am after if possible is -

If The department name in the raw data matches column A1 for example then it auto populates down in B2 all the names of people who work in that department .

## Create List Of Unique Values

Jul 23, 2007

In column A I have values starting at row 4, ranging up to row 1004.

in coulumn Q (starting at row 3) I'd like a list of unique entries from column A

I know this line is my problem

If Range("A" & I) Range("Q4:Q30") Then
but i'm not sure how to compare against all values in a range

Sub FilterSymbol()
Dim I As Integer
Dim X As Integer
X = Range("O2")
I = 4

Do
If Range("A" & I) Range("Q4:Q30") Then
Range("Q" & I) = Range("A" & I)
I = I + 1
Else: I = I + 1
End If
Loop Until I >= X
End Sub

## Create Unique List From 2 Lists

Oct 3, 2007

I have a number of text columns, side by side in a worksheet, containing names. I wish to combine these columns into one new column, removing any duplicates, to create a single list of names. Is there a simple way to do this?

## Formula To Create List Of Unique Items

Feb 12, 2009

I have a column that looks something like (it is VERY long and has over 20 different names):

abe
abe
abe
abe
ben
ben
ben
cat
cat
john
john
john
john
tex
tex

I want to create another column (automatically) that lists each of of those once:
abe
ben
cat
john
tex

Any idea of how I can do this automatically?

## Create Unique List In Shortest Time..

Jun 17, 2009

I have a list of project numbers that is over 7000 rows long [example attached].
Many numbers are repeated. This list comes out of a financial reporting system.
I need to extract a list of unique numbers in numerical order. I have two solutions working, one with SUMPRODUCT formulas and one with MACRO. Here's the MACRO solution. But it takes about 20 seconds to execute. I am just looking to cut down on execution time. I am using this macro a few times on different lists in the same program. Is there a better [faster] way to do this?

## Create Unique List Of Values Across 5 Sheets

Oct 13, 2011

I am trying to create a macro that will create a unique list of the values in the same column across 5 worksheets, "Question1", "Question2", etc, and place the list in a new worksheet, "Summary".

The values are in column A in all of the worksheets, and the number of rows in each worksheet will change each day. I need the unique list to be added to the sixth worksheet, "Summary".

Also, after the list is created on the Summary worksheet, I need a count of each field by worksheet and a total. This is how I currently have the Summary set up:

Part Type|Total|Question1|Question2|Question3|Question4|Question5
Name|=SUM(C2:F2)|=COUNTIF(Question1!\$A:\$A,A2)|
=COUNTIF(Question2!\$A:\$A,A2)|=COUNTIF(Question3!\$A:\$A,A2)|
=COUNTIF(Question4!\$A:\$A,A2)|=COUNTIF(Question5!\$A:\$A,A2)

## Create Unlimited Unique Validation List

Jun 16, 2009

Any way in ms excel to create unlimited unique validation list. i am working on a small data where one colums data(Validation list) changes on the selection of previous column data filed. i am using indirect function with defined name range. but ms-excel is not accepting new names now and still i have 75 datagrops left to define and validate.

is there any formula or vba code to fix this problem.

## Create Unique List & Summarize All Associated Values

Jan 30, 2009

I have a list of sales events that ran at various venues, together with how many people attended and how much revenue was brought in by sales. This data is arranged by week. One venue will never have more than one event per week, but different venues may have sales events on the same week.

My table looks like:

In reality this list could be thousands of rows long.

“Event week” is the calendar week of the event. “Weeks open” shows for each event how many weeks that venue has been open (may or may not be useful!).

What I need to do is to be able to pick a number of weeks (preferably changeable by entering into a cell) and have a list produced of each venue that has run for at least that many weeks, and the sum of people and sales in those first X weeks. My idea of output, if the user input “2” as the number of weeks would therefore look something like:

Note that
1)only venues that have run at least 2 meetings are shown in the output
2)even if venue has run over 2 meetings, only people and sales figures from the first 2 are summed up and displayed.

In this case. Later on I need to produce a frequency chart/histogram grouping the results into categories, but I know how to do this as long as I can get to the step before – but wanted to mention it in case there are shortcuts.

Have been battling with this with pivots, database functions, array formulae etc. for a long time.

Attached is the spreadsheet with sample data. The red table is the part I am stuck on. The solution has to work in Excel 2003.

## Create Unique List From Column With A Condition

Jun 3, 2007

I have a test sheet thus :

+ABCDEFG
1Bob11234
2Sally2
3Ann3
4Emily4
5Lexi3
6Bill2
7Josh1
8Jacob2
9Mary3
10Gary4
11

In D2:D11, I want a non-duplicate list of all the "1" names, i.e., Bob and Josh. In E2:E11, a list of all the "2" names (Sally, Bill & Jacob), and so on. Sorted would be nice, but not necessary. When new names and their numbers are added to A1:B200, they need to automatically show up in D2:G:201 as appropriate. I've looked over VLOOKUP, INDEX, MATCH, etc., but all seem to simply return the first and not every match. Maybe I'm just missing it.

Is this possible without VBA? Not that I have any objection to it, but delving into and learning it is a little outside the available time I have now. If it takes VBA I'll address it when I can free up some time.

## AdvancedFilter Macro To Create Unique List

Aug 27, 2007

In Excel I recorded a macro by carrying out some operations and then copied the code into VBA code window to the click event of a button expecting the code would operate well but in vain. What is wrong with my operations? By cliking command button placed on a userform I want to copy the date of one column to another and the data thus copied into another column should contain only unique value.

## Create Unique List From Column With Duplicates

Feb 27, 2008

I want to end up with a list of unique items (nothing repeated) from a variable length list starting in cell B5. That unique list is then placed in cell D3.

I am using the code below (found on Ozgrid) which almost works. But it seems to be dependent on what’s in column A (which I wish to ignore) for it to work.

How can I modify the code so that the results are based on column B only?

Dim Rng As Range
Dim fRng As Range
Dim lRow As Long
Dim Dest As Range

lRow = Range("B" & Rows.Count).End(xlUp).Row
Set Rng = Range("A5:B" & lRow)
Set Dest = [D3]

With Rng
. AutoFilter Field:=1, Criteria1:="1*"
Set fRng = .Offset(1, 1).Resize(.Rows.Count - 1, 1).SpecialCells(xlCellTypeVisible)
With fRng
.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Dest, Unique:=True

End With
End With

## Create Unique List & AutoFilter 2 Tables By Same Value

Mar 23, 2008

I have a table and say I would like to create a unique list from column2 and store the list in a spearate sheet. Give this unique list a name.

Use this unique list in a FOR EACH loop and apply autofilter to two tables on two different sheets.
(one table is from which the unique list was created and other in a different sheet)

## Create Unique List Of Values From Two Ranges With Criteria?

Jun 12, 2014

I have two lists of values in separate columns with condition in adjacent cells, all on the same sheet

List 1 consists of numbers from 1 to 12, column to the right is either blank or Free
List 2 consists of numbers from 13 to 24, column to the right is either blank of Free

List 1 starts in A2, B2 is either blank or Free
List 2 starts in D2, E2 is either blank or Free

In column G, from G2 i want it to list all values from List 1 and List 2 where their status is Free

## Importing Values From Sheets To Create Unique List

Jun 2, 2009

I need to be able to pull information from 5 columns on 5 different pages, and pull all of the unique names out of it. From there, I need to create a list of all of these names. More often than not, this could only be three names, but I still would like this to be automatic because eventually it could be 50 or 60, and manually editing this list would get tedious. Lastly, is it possible to have a list create cells? For example: I have information on row 4, this one will start on row 6. My next group of information starts on row 14. That leaves 7 rows for information. I don't want to leave a large gap at the top of the page, so I'd like to be able to create cells if the list I'm trying to create has more information on it. Seems plausible in my mind, but I'm still new to excel.

## Create Unique Values List While Overwriting Old Data?

Jan 24, 2012

I will copy a report into sheet 1, starting in the same place(A1), on a weekly basis. The headers are: Item, Quantity & Price

Week 1's report shows the following:
Windows 5 \$1.00
Doors 6 \$1.50
Chairs 7 \$2.00

Week 2's report shows the following:
Windows 3 \$1.00 (change in quantity)
Tables 7 \$5.00 (new item)
Chairs 7 \$2.50 (change in price)

I need to have a rolling, unique list on Sheet 2 that will do the following:

- add new line items

- keep old line items while checking to see if the quantity or price has changed.

Therefore, after week 2's report is pasted on sheet 1, Sheet 2 should look like this:

Windows 3 \$1.00
Doors 6 \$1.50
Chairs 7 \$2.50
Tables 7 \$5.00

Here's the most important part: There will be formulas in Column D in Sheet 2 that I need to stay with each item. generating the desired result on Sheet 2!

## Macro To Create Unique Rolling Data List

Feb 4, 2012

I need a Macro to create a unique, rolling data list. On Sheet 1, a report is pasted(from outside source) in cell A3(Rows 1 & 2 are headers) on a weekly basis. It is always the same amount of columns wide(138). The number of rows will always vary but will never be more than 500.

Hereâ€™s what I need for Sheet 2:

-Column A should be a copy from Column A on Sheet 1 (data is ITEMS)
-Column B should be a copy from Column BH on Sheet 1 (data is QUANTITY of items)
-Column C should be a copy from Column BI on Sheet 1 (data is PRICE of items)

Hereâ€™s the challenge (when the new report is pasted on Sheet 1):

-Sheet 1. Find new ITEMS not on Sheet 2 and paste them at the end of the report on Sheet 2 along with their QUANTITY and PRICE
-Sheet 1. Find any ITEMS already on Sheet 2, then update new QUANTITY and PRICE from Sheet 1 onto Sheet 2
-Sheet 2. Leave ITEMS alone that are now missing from the new report on Sheet 1

## Create Unique List Each Time Worksheet Is Activated

Jan 13, 2008

I am getting a run time error 1004 during a copy-paste of a named range. I've read other posts and the help file and know it's related to defining an object, but I'm not clear on exactly what hasn't been defined.

Private Sub Worksheet_Activate()

Dim lCell As Range
Set lCell = Worksheets("Sheet1").Range("C65536").End(xlUp).Offset(1, 0) ' find first blank cell in the column

With Worksheets("Sheet1").Range("AllDates") 'filter duplicate dates
. AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
"E7"), Unique:=True
End With

Worksheets("Sheet1").Range("Dates_Filtered").Copy Destination:=Worksheets("Sheet1").Range("lCell") ' fails on this line
Range("Dates_Filtered").Clear

End Sub

## Create Helper Column That Marks Distinct Values

Nov 26, 2012

I have a table with 200.000 rows.

I need to create a helper column, that marks distinct values with 1 and not distinct "" or 0.

I tried the following but both use countif and I believe it is the problem it's just to slow.

=IF(COUNTIF(\$A\$2:A2;A2);1;0)
=1/COUNTIF(\$A\$2:A2;A2)

but both are really slow +20 mins to calculate and many times Excel crashes( 2007 32bit).

The workbook is really simple

Col1 (number formatted as text) - Col2 =distinct

## Excel 2010 :: Limitation On Formula To Create List Of Unique Items

Jan 21, 2014

Excel 2010. There is a limit to the usability of the

=INDEX(\$A\$1:\$A\$1000,MATCH(0,COUNTIF(\$A\$1:\$A\$1000,"<"&\$A\$1:\$A\$1000),0))

method. It seems like the limitation is in the Countif function going over 1000 (or some other size limit)

I have a list of ~1500 rows, of that there are approximately 55 unique items. Doing the unique array works correctly up until item ~40, upon which it fails by returning the 1st item only (for the rest).

Trying to debug, and pulling out the Match section, it functions up until 976 (that is

MATCH(0,COUNTIF(\$N\$1:\$N40,\$C\$3:\$C\$1500),0)

returns 976) anything after returns just 1 (1st item).

It seems to be a limitation on the text string size that COUNTIF can handle.