Solved

How to select the Distinct values of a Column.

Posted on 2011-09-15
6
168 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
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…
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 how to use a scrolling table in Microsoft Excel using the INDEX function.

707 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

20 Experts available now in Live!

Get 1:1 Help Now