Solved

How to select the Distinct values of a Column.

Posted on 2011-09-15
6
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
My experience with Windows 10 over a one year period and suggestions for smooth operation
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

749 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