Counta on dynamic Filter

hnd12000

New Member
Joined
Feb 10, 2019
Messages
22
Office Version
  1. 365
Platform
  1. Windows
What is the way to have the Filter function (dynamic range on Office 365) to return 0 instead of 1 when the filter finds nothing ?

in whether I put "" in If empty of the FILTER or not, COUNTA still counts 1 :

=FILTER(Database[Number],Database[Submitted Date]>'3PF dashboard'!C1) -> #CALC! which is normal because no items meet the condition but
=COUNTA(FILTER(Database[Number],Database[Submitted Date]>'3PF dashboard'!C1)) -> 1

=FILTER(Database[Number],Database[Submitted Date]>'3PF dashboard'!C1,"") -> "" (empty) but
=COUNTA(FILTER(Database[Number],Database[Submitted Date]>'3PF dashboard'!C1,"") -> 1

As a result I can't differentiate between the genuine cases where the count should be 1 and the one where none are found
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Welcome to the forum, can you post a sample of your data using the boards XL2BB addin (the XL2BB icon in the reply window is a link to the download and instructions), making sure that you check the "Show formulas" and click the "Generate output" so we can see the formulas and what the names refer to.
 
Upvote 0
See if this way works for you.

Excel Formula:
=IFERROR(ROWS(FILTER(Database[Number],Database[Submitted Date]>'3PF dashboard'!C1)),0)
 
Upvote 0
Another way
Excel Formula:
 =COUNT(FILTER(ROW(Database[Number]),Database[Submitted Date]>'3PF dashboard'!C1))
 
Upvote 0
You're welcome. Glad we could help. Thanks for the follow-up. :)

Actually, if your Database heading of 'Number' is a true reflection of what is in that column (that is numbers, not text) then just changing COUNTA to COUNT in your original formula should also work shouldn't it?

Excel Formula:
=COUNT(FILTER(Database[Number],Database[Submitted Date]>'3PF dashboard'!C1))
 
Upvote 0
No. Data is text. So only Counta could work.
I just couldn't figure out how to deal with the no filter found and ended up with a super complex multi cell solutions until you guys came up with the ROWS & ROW solution above.
My principle : if you need 2 cells to calculate something, it means that there is 1 to many.
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,853
Members
449,051
Latest member
excelquestion515

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