Count Unique Values excluding blanks and one value

richard_d1

New Member
Joined
Feb 7, 2022
Messages
12
Office Version
  1. 365
Platform
  1. Windows
I've got a range of letters, and I want to calculate how many unique values occur in it, excluding the letter A and empty cells.

I've used the formula
Excel Formula:
=COUNTA(UNIQUE(FILTER(A1:A10,(A1:A10<>"A")*(A1:A10<>""))))
which works fine, except when the result should be zero.

Here are some examples:
Book1
ABCDEFGHI
1BABA
2CBBA
3DCBA
4BDBA
5CABA
6DBBA
7BC
8CD
9D
10
11
1233111
Sheet1
Cell Formulas
RangeFormula
A12,I12,G12,E12,C12A12=COUNTA(UNIQUE(FILTER(A1:A10,(A1:A10<>"A")*(A1:A10<>""))))


The first three work, counting the number of unique values, except A and empty cells. But the last two should return 0, but don't, as COUNTA is counting #VALUE as 1.

I've tried all sorts, but can't figure out how to do it.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hello, if you do not insist on using FILTER (which would make the formula longer) then e.g.

Excel Formula:
=SUMPRODUCT((UNIQUE(A1:A10)<>"A")*(UNIQUE(A1:A10)<>""))
 
Upvote 1
Solution
Change the CountA to Rows & then wrap the whole thing in IfError.
 
Upvote 1
Glad we could help & thanks for the feedback.
 
Upvote 0
Here's another way...

Excel Formula:
=SUM(IF(LEN(UNIQUE(FILTER(A1:A11,(A1:A11<>"A"))))>0,1))
 
Upvote 1

Forum statistics

Threads
1,224,809
Messages
6,181,076
Members
453,020
Latest member
mattg2448

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