Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to select the Distinct values of a Column.

Posted on 2011-09-15
6
Medium Priority
?
178 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 1000 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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 27

Assisted Solution

by:Glenn Ray
Glenn Ray earned 1000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
New style of hardware planning for Microsoft Exchange server.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

618 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