COUNTA + UNIQUE + FILTER returning 1 instead of 0, IFERROR not working

desklamp33

New Member
Joined
Oct 7, 2022
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello!

I need to count unique values based on two criteria and this is the formula I've come up with. It successfully gets what I want, EXCEPT it returns a 1 when it should be returning a 0. I tried adding in an IFERROR function so that it doesn't count any #N/A's that the FILTER function returns but that is not working.

=COUNTA(UNIQUE(IFERROR(FILTER(2021_sales[SKU],(2021_sales[Price Bucket]=[@[Price Bucket]])*(2021_sales[Subcategory]=[@Subcategory])),"")))

Thank you!
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi & welcome to MrExcel.
Swap the Counta for Rows & wrap it in Iferror.

EDIT:
And remove the existing Iferror
 
Upvote 0
Solution
Hi & welcome to MrExcel.
Swap the Counta for Rows & wrap it in Iferror.

EDIT:
And remove the existing Iferror

That worked - thank you so much!

For anyone else viewing this thread, here is the formula that solved my issue:
=IFERROR(ROWS(UNIQUE(FILTER(2021_sales[SKU],(2021_sales[Price Bucket]=[@[Price Bucket]])*(2021_sales[Subcategory]=[@Subcategory])))),0)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,597
Messages
6,125,738
Members
449,255
Latest member
whatdoido

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