• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 180
  • Last Modified:

How to select the Distinct values of a Column.

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
MikeMCSD
Asked:
MikeMCSD
  • 3
  • 2
2 Solutions
 
netjgrnautCommented:
Probably easiest to do this with VBA in Excel.

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

Hope that helps!
0
 
MikeMCSDAuthor Commented:
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
 
netjgrnautCommented:
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!

 
Glenn RayExcel VBA DeveloperCommented:
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
 
netjgrnautCommented:
I like GlennLRay's answer better.  :-)
0
 
MikeMCSDAuthor Commented:
thanks guys
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now