Solved

Unique values

Posted on 2014-04-26
10
111 Views
Last Modified: 2014-04-26
Applying AdvancedFilter Unique:=True to a simple column (A) values of, say, 1,1,1,1,1,2,3,4,5,6,7,7

will result in :

1,1,2,3,4,5,6,7

and NOT the required 1,2,3,4,5,6,7

Why?  Thanks, k.
0
Comment
Question by:krakatoa
  • 5
  • 4
10 Comments
 
LVL 43

Assisted Solution

by:Saqib Husain, Syed
Saqib Husain, Syed earned 250 total points
ID: 40024526
Because the first 1 is considered as a field name. Change the first 1 to a meaningful name like "Numbers" and then try it.
0
 
LVL 16

Author Comment

by:krakatoa
ID: 40024537
Your comment of course works. But I find it impossible to see that can be reasonable behaviour by Excel. I have no need nor opportunity of identifying a column header - field name -  in my data. Cell A1 should be treated as any other cell in the range. Surely there must be a fully unique-compliant way of doing this?

What's more, the field header will end up in any copying of the data that I do, and I do not want that at all.

I'd go so far as to say that IMO it's one of the most ridiculous and application-defeating, lame functions I've yet seen in Excel. The fact that the Filter function has no optional header exclusion parameter is beyond belief.
0
 
LVL 34

Accepted Solution

by:
Dan Craciun earned 250 total points
ID: 40024553
You can do this in VBA and you will get the results you want:
ActiveSheet.Range("$A$1:$A$20").RemoveDuplicates Columns:=1, Header:=xlNo

Open in new window

Or just go to Data->Remove Duplicates and leave the "My data has headers" box unchecked.

HTH,
Dan
0
 
LVL 16

Author Comment

by:krakatoa
ID: 40024560
Dan - thanks but

438 Error - Object doesn't support this property or method.
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 40024567
It does on Excel 2013.
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 16

Author Comment

by:krakatoa
ID: 40024569
I have Excel 2000. :(
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 40024636
Well, someone at Microsoft will be happy about the next question: maybe it's time to upgrade? :)
0
 
LVL 16

Author Comment

by:krakatoa
ID: 40024727
Yeah . . .  s/one at MS is always happy I'd reckon. ;)

The fact is I'd already written my own (very long, but effective) de-dupe routine, but as it's in a sub with a load of other stuff, I wanted to make a new sub - which also will need a de-dupe routoine too -, less busy by using this AdvancedFilter option. Now that I see I can't, I'll have to use my own again. But even *that* leaves a bitter taste, as, like you said, it's all redundant if one has 2013.
0
 
LVL 34

Expert Comment

by:Dan Craciun
ID: 40024764
This says that the RemoveDuplicates method is available since Excel 2007.
0
 
LVL 16

Author Comment

by:krakatoa
ID: 40024785
Yup. But as I said, I have Excel 2000.
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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

920 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

14 Experts available now in Live!

Get 1:1 Help Now