How do I count the duplicate values in a range only once.

scrainey

Board Regular
Joined
Apr 25, 2004
Messages
71
How do I count the duplicate values in a range only once.

I would like to count the number of purchase orders in column "A", and some cells will contain duplicates, I only want to count the duplicates once, the remaining duplicates should not be included in the count.

example:

PS04-120001
PS04-120001
PS04-120002
___________

= 2

Any help would be appreciated
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Like this?
Book1
ABCDE
1PurchaseOrderDuplicates
2PS04-1200011
3PS04-1200010
4PS04-1200021Total7
551
611
750
821
931
1041
1130
Sheet1
 
Upvote 0
Re: How do I count the duplicate values in a range only once

If you can download Morefunc's addin, you can use COUNTDIFF,

Edit for Sumproduct
Book1
ABCD
1ps04-12000122
2ps04-120002
3ps04-120001
Sheet1
 
Upvote 0
Re: How do I count the duplicate values in a range only once

This is not working it returnes a valve of 1 for some reason :oops:
 
Upvote 0
Re: How do I count the duplicate values in a range only once

scrainey said:
This is not working it returnes a valve of 1 for some reason :oops:

Which formula are you using? You might also check for leading or trailing spaces in you column.
 
Upvote 0
Re: How do I count the duplicate values in a range only once

Hi scrainey:

Using the Data layout in column A of DRJ (Jacob's) post you could use ...

=SUMPRODUCT(--(COUNTIF(A2:A11,A2:A11)>1))
 
Upvote 0
Re: How do I count the duplicate values in a range only once

If the range contains any blank cells, either by omission or formula generated blanks (""), both Countif formulas will fail. Although having blank cells was not implied by the OP.
 
Upvote 0
Re: How do I count the duplicate values in a range only once

Hi,

I am trying to do the above and was reading this post. Where can I get the addin?

Cheers
Justin
 
Upvote 0

Forum statistics

Threads
1,214,542
Messages
6,120,116
Members
448,945
Latest member
Vmanchoppy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top