Solved

How to select the Distinct values of a Column.

Posted on 2011-09-15
6
169 Views
Last Modified: 2012-08-14
I have columns that have repeating values for the rows, like "Ear Care, Pain Relief, Joint Care, Bathing".

Is there a way I get a list of all these distinct values?
(I want a list of all the values without them repeating)

It would be like using "Select Distinct . ." in SQL.

Please explain how to do it using simple steps because I don't use Excel at all
and don't even know to do simple things.

Thanks


0
Comment
Question by:MikeMCSD
  • 3
  • 2
6 Comments
 
LVL 6

Expert Comment

by:netjgrnaut
ID: 36544542
Probably easiest to do this with VBA in Excel.

http://www.cpearson.com/excel/distinctvalues.aspx

Hope that helps!
0
 
LVL 16

Author Comment

by:MikeMCSD
ID: 36544621
thanks, but I need a "plug this in there" because like I said, I don't know $#@% about Excel.
I know one thing about Excel : I hate it.
0
 
LVL 6

Accepted Solution

by:
netjgrnaut earned 250 total points
ID: 36544838
Download the .bas module file (from the link provided on the page I posted previously), then review the "Examples of calling" section on that page for an example that resembles your need (probably the first one, if I understand what you're trying to do).

Once you've downloaded the .bas file (actually a zip file, so unzip the bas file to somewhere), you'll need to import it into your Excel workbook using the VBA tool.  If you tell me what version of Excel you're running, I can help you get the .bas file imported.

Once you've imported the .bas file, you'll be able to use the new function as described in the Examples section of the link I posted originially.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 27

Assisted Solution

by:Glenn Ray
Glenn Ray earned 250 total points
ID: 36545416
Here are two methods for extracting a distinct list of values from a column without using VBA

1)  Create a Pivot Table from the data  (place cursor anywhere in your data then:  
2007 Menu:  Insert, Pivot Table, accept default values and click OK button)
Then, add the column where you have repeating values into the Row Labels section.  Only the unique values will be shown.

2) Use advanced filtering to select unique values:
Highlight the entire column you want to analyze, including the header row, if any.
2007 Menu:  Data, Sort&Filter : Advanced
Select "Copy to another location"
In the "Copy to" box, choose one cell where you would like to see the unique list of values (ex.  "D1"..or any cell outside your data range)
Click the check box marked "Unique Records Only"
Click OK

A list of only the unique values will be entered starting in the cell you specified.

0
 
LVL 6

Expert Comment

by:netjgrnaut
ID: 36545722
I like GlennLRay's answer better.  :-)
0
 
LVL 16

Author Comment

by:MikeMCSD
ID: 36546139
thanks guys
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel Formula 4 28
Freeze Panes Solution 6 28
SUMIFS with a criteria that could be in multiple rows 21 29
Access Excel export not behaving 2 23
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Outlook Free & Paid Tools
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now