ExcelTip.com
Account Icon Account Icon Account Icon
ExcelTip.com

Go Back   Excel Help Forum > Usenet Groups > Excel General

Notices

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 09-07-2008, 06:47 PM
Wskip49 Wskip49 is offline
Registered User
 
Join Date: 08 Mar 2007
Posts: 83
Wskip49 is on a distinguished road
Count only duplicates

I would like to be able to count only the duplicate numbers without having to put the actual number in the formula.

123456
56478
951753
7727969
08259186
10741916
10741916
123456
123456

=countif(duplicate)
Reply With Quote
  #2  
Old 09-07-2008, 06:53 PM
Ron Coderre's Avatar
Ron Coderre Ron Coderre is offline
Cheeky Forum Moderator
 
Join Date: 22 Mar 2005
Location: Massachusetts
Posts: 2,071
Ron Coderre will become famous soon enough Ron Coderre will become famous soon enough
Send a message via Yahoo to Ron Coderre
Counting only duplicates

With
A1:A9 containing your posted list:
123456
56478
951753
7727969
8259186
10741916
10741916
123456
123456

This formula returns the count of values that are duplicated in that list:
Code:
B1: =SUMPRODUCT(--(COUNTIF(A1:A9,A1:A9)>1))
With that data, the formula returns: 5
Code:
123456----3 instances
10741916--2 instances
Is that what you're looking for?
__________________
Regards,

Ron
Microsoft MVP (Excel)

Click here to see the Forum Rules
Reply With Quote
  #3  
Old 09-07-2008, 07:19 PM
Wskip49 Wskip49 is offline
Registered User
 
Join Date: 08 Mar 2007
Posts: 83
Wskip49 is on a distinguished road
That works great however, if there is a formula in the cell it counts it. Is there a way to only count the answer to the formula?
Reply With Quote
  #4  
Old 09-07-2008, 07:22 PM
shg's Avatar
shg shg is offline
Forum Moderator
 
Join Date: 21 Jun 2007
Location: Dallas, Texas
Posts: 6,160
shg will become famous soon enough shg will become famous soon enough
... Pardon?
Reply With Quote
  #5  
Old 09-07-2008, 07:32 PM
Wskip49 Wskip49 is offline
Registered User
 
Join Date: 08 Mar 2007
Posts: 83
Wskip49 is on a distinguished road
I have this formula in $A$2:$A$12. Using the formula you gave, Thank you, it counts the formula in each of the cells as duplicates.

This is the formula I have in each cell.

Code:
=IF(ISERROR(INDEX(Stu_ID,MATCH(F3,Names,0))),"",INDEX(Stu_ID,MATCH(F3,Names,0)))
Reply With Quote
  #6  
Old 09-07-2008, 07:56 PM
shg's Avatar
shg shg is offline
Forum Moderator
 
Join Date: 21 Jun 2007
Location: Dallas, Texas
Posts: 6,160
shg will become famous soon enough shg will become famous soon enough
It was Ron's formula.

It counts the duplicates in the results of the formulas, not duplicate formulas.
Reply With Quote
  #7  
Old 09-07-2008, 10:05 PM
Wskip49 Wskip49 is offline
Registered User
 
Join Date: 08 Mar 2007
Posts: 83
Wskip49 is on a distinguished road
I don't have a zip file and I can't get the file downloaded. Thanks so much for you help.

Last edited by Wskip49; 09-07-2008 at 10:18 PM.
Reply With Quote
  #8  
Old 09-07-2008, 10:28 PM
shg's Avatar
shg shg is offline
Forum Moderator
 
Join Date: 21 Jun 2007
Location: Dallas, Texas
Posts: 6,160
shg will become famous soon enough shg will become famous soon enough
If you're running XP, just right-click the file and select Send to compressed folder
Reply With Quote
  #9  
Old 09-08-2008, 10:26 AM
Wskip49 Wskip49 is offline
Registered User
 
Join Date: 08 Mar 2007
Posts: 83
Wskip49 is on a distinguished road
County only duplicates

Thanks for the tip on Compressing the file. I have attached.
Attached Files
File Type: zip MAJ Discipline Log 08-09.zip (37.5 KB, 4 views)
Reply With Quote
  #10  
Old 09-08-2008, 11:44 AM
shg's Avatar
shg shg is offline
Forum Moderator
 
Join Date: 21 Jun 2007
Location: Dallas, Texas
Posts: 6,160
shg will become famous soon enough shg will become famous soon enough
I would define

StuNo Refers to: =OFFSET(School!$A$1, 1, 0, COUNT(School!$A$1:$A$13))

Then,

Total Referrrals =COUNT(StuNo)

(assumes that student numbers are indeed numbers, and no interspersed blank rows between student numbers)

# Students Involved =SUMPRODUCT( 1 / COUNTIF(StuNo, StuNo) )
Reply With Quote
  #11  
Old 09-08-2008, 12:08 PM
Wskip49 Wskip49 is offline
Registered User
 
Join Date: 08 Mar 2007
Posts: 83
Wskip49 is on a distinguished road
This formula is just the ticket.

Quote:
=count(stu_id)

This formula give me a #DIV/0!.
Code:
=SUMPRODUCT( 1 / COUNTIF(Stu_ID, Stu_ID) )
Reply With Quote
  #12  
Old 09-08-2008, 01:29 PM
shg's Avatar
shg shg is offline
Forum Moderator
 
Join Date: 21 Jun 2007
Location: Dallas, Texas
Posts: 6,160
shg will become famous soon enough shg will become famous soon enough
I don't know how you've defined Stu_ID.
Reply With Quote
  #13  
Old 09-08-2008, 02:25 PM
Wskip49 Wskip49 is offline
Registered User
 
Join Date: 08 Mar 2007
Posts: 83
Wskip49 is on a distinguished road
I named "stu_id" from another file ('[Student Info update.xls]Sheet1'!$A:$A) which contains about 650, 8 digit numbers, this is the formate I used, Custom 0#######.
Reply With Quote
  #14  
Old 09-08-2008, 02:34 PM
shg's Avatar
shg shg is offline
Forum Moderator
 
Join Date: 21 Jun 2007
Location: Dallas, Texas
Posts: 6,160
shg will become famous soon enough shg will become famous soon enough
=SUMPRODUCT( 1 / COUNTIF(Stu_ID, Stu_ID) )

... gives the number of unique values in a list that may contain duplicates. Why would you apply it to the master list, which should not include any duplicates? In that event, it should give the same result as COUNT (if they are all indeed numbers), but it's needlessly demanding.
Reply With Quote
  #15  
Old 09-08-2008, 02:51 PM
Wskip49 Wskip49 is offline
Registered User
 
Join Date: 08 Mar 2007
Posts: 83
Wskip49 is on a distinguished road
I have the student number indexed and matched to the student name. I type the student name and his Student Number, Grade Level, Home Room, Ethnicity, *** and if he/she has special needs. I hope that explains. I hate to keep bothering everyone with these simple problems. I am trying to learn as much as I can.
Reply With Quote
Reply

Bookmarks

New topics in Excel General


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Use The Count Function Like This? atech Excel Programming 1 06-25-2008 12:36 AM
Find and count Duplicates flds Excel General 2 06-19-2008 10:55 PM
Duplicates! Count, Remove, Highight, etc... ImpetuousRacer Excel Programming 4 11-21-2007 03:02 PM
How to use the count function? atech Excel Programming 2 09-21-2007 02:01 AM
How do i count duplicates and produce a sumary? xyz123 Excel Worksheet Functions 3 05-31-2007 10:21 AM


All times are GMT -4. The time now is 03:35 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0