How do I determine if a sorted column has duplicates
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
duplicate keys (Office 2000)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » duplicate keys (Office 2000)
- This topic has 10 replies, 4 voices, and was last updated 23 years, 8 months ago.
AuthorTopicWSartjaniger
AskWoody LoungerSeptember 20, 2001 at 10:58 am #360576Viewing 1 reply threadAuthorReplies-
WSpieterse
AskWoody LoungerSeptember 20, 2001 at 11:56 am #543298 -
WSartjaniger
AskWoody LoungerSeptember 21, 2001 at 6:17 pm #543592I tried your array formula and it worked – thanx
I would like to understand what the array formula is doing
Why the construct “1/countif….)”? Does this mean “1 divided by the result of the countif”?
I would guess not.I assume that the first a1:a6 represents the range being checked.
I’m guessing that the stuff following the comma breaks down into “=a1 or =a2 or =a3 or =a4 or =a5 or =a6”. How does it know to check “unique” occurrences?
Why the control-shift-enter (i read in a book that this places the formula in each of the array cells, but I don’t know what that means)!
The counta – now that’s something i can understand
-
WSpieterse
AskWoody LoungerSeptember 24, 2001 at 5:07 am #543793An array formula can operate on an array of numbers, thus avoiding the need to copy a normal formula accross several cells (which is possible of course and yields the same result). In short, a well devised array formula does a calculation in one cell, which would otherwise require a whole table. One tells XL a formula is an array formula by pressing control-shift-enter.
The array formula works like this:
– for each entry in A1:A6, it counts how many times it occurs. Then it reciprocates the result. If the cells contain:
A,A,B,B,B,C
then the resulting array of values of the 1/countif function is:
1/2 , 1/2, 1/3 , 1/3 , 1/3 , 1/3 , 1
Summing this array yields 3, the number of unique entries.
-
WSartjaniger
AskWoody Lounger
-
-
-
-
H. Legare Coleman
AskWoody PlusSeptember 24, 2001 at 1:03 pm #543317This VBA code will tell you which cells in the current selection are duplicates. It expects the selection to be in a single column, and to be sorted. It also uses one cell beyond the end of the selection, so that cell should not be the same as the last cell in the selection or it will give a false hit.
Public Sub FindDups() Dim oCell As Range For Each oCell In Selection If oCell.Value = oCell.Offset(1, 0).Value Then MsgBox oCell.Address & " and " & oCell.Offset(1, 0).Address & " are duplicates." End If Next oCell End Sub
-
WSartjaniger
AskWoody Lounger -
H. Legare Coleman
AskWoody PlusSeptember 21, 2001 at 11:20 pm #543639Open the workbook and then press Alt+F11. That should put you in the VBA Editor (known as VBE). Make sure that your workbook is selected in the project explorer at the left of the screen, and then select “Module” from the Insert menu. You should now have a Module in the right window where you can put VBA code.
-
WSSammyB
AskWoody Lounger -
H. Legare Coleman
AskWoody Plus
-
-
-
-
WSartjaniger
AskWoody Lounger
-
Viewing 1 reply thread -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Discover the Best AI Tools for Everything
by
Alex5723
54 minutes ago -
Edge Seems To Be Gaining Weight
by
bbearren
3 hours, 13 minutes ago -
Rufus is available from the MSFT Store
by
PL1
11 hours, 52 minutes ago -
Microsoft : Ending USB-C® Port Confusion
by
Alex5723
14 hours, 1 minute ago -
KB5061768 update for Intel vPro processor
by
drmark
17 minutes ago -
Outlook 365 classic has exhausted all shared resources
by
drmark
12 hours, 12 minutes ago -
My Simple Word 2010 Macro Is Not Working
by
mbennett555
9 hours, 47 minutes ago -
Office gets current release
by
Susan Bradley
12 hours, 24 minutes ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
2 days, 2 hours ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
1 day, 10 hours ago -
Stop the OneDrive defaults
by
CWBillow
2 days, 3 hours ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
2 days, 13 hours ago -
X Suspends Encrypted DMs
by
Alex5723
2 days, 15 hours ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
2 days, 15 hours ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
2 days, 16 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
2 days, 16 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
2 days, 5 hours ago -
Enabling Secureboot
by
ITguy
2 days, 12 hours ago -
Windows hosting exposes additional bugs
by
Susan Bradley
3 days ago -
No more rounded corners??
by
CWBillow
2 days, 20 hours ago -
Android 15 and IPV6
by
Win7and10
2 days, 10 hours ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
3 days, 13 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
3 days, 15 hours ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
3 days, 10 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
3 days, 23 hours ago -
May preview updates
by
Susan Bradley
3 days, 10 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
3 days, 2 hours ago -
Just got this pop-up page while browsing
by
Alex5723
3 days, 15 hours ago -
KB5058379 / KB 5061768 Failures
by
crown
3 days, 12 hours ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
2 days, 14 hours ago
Recent blog posts
Key Links
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.