Count non-empty cells, but don't count if repeat

cgmojoco

Well-known Member
Joined
Jan 15, 2005
Messages
699
Subject describes it all
I have:

Code:
 =COUNTA(C3:C100)

But if more than one cell contains the same value, I don't want to count it more than once, only once...how would I do this?

Thank you in advance
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Courtesy of Fairwinds:

=SUMPRODUCT((A1:A10<>"")/COUNTIF(A1:A10,A1:A10&""))
 
Upvote 0
=SUMPRODUCT((C3:C100<>"")/COUNTIF(C3:C100,C3:C100&""))

Ok, thanks that did the trick, now I need to know how to exclude 0's from registering as a counted item.

DOH, nevermind, I just needed to add -1 at the end ;)
 
Upvote 0
cgmojoco said:
=SUMPRODUCT((C3:C100<>"")/COUNTIF(C3:C100,C3:C100&""))

Ok, thanks that did the trick, now I need to know how to exclude 0's from registering as a counted item.

DOH, nevermind, I just needed to add -1 at the end ;)

You mean of course:

SUMPRODUCT(...)-(COUNTIF(C3:C100,0) > 0)

A fast alternative is:

=COUNTDIFF(A1:A6,FALSE,0)

if you download and install the morefunc.xll add-in.
 
Upvote 0

Forum statistics

Threads
1,211,679
Messages
6,103,244
Members
447,849
Latest member
4chase

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