Filter Formula W/ 3 Criteria (Leaving Blank will populate all)

FiggyDad

New Member
Joined
Jan 30, 2024
Messages
4
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
Okay, let me try and explain... I have a sheet that lists asset assignments, there are three criteria I'm working with, user type, user status and device type. The user type would include Staff, Student, Room. The user status would include Active or Inactive. And the device type would include laptop, chromebook, ipad, etc... I have drop down lists to select what you want to filter, but I also want the ability to include ALL results if I delete any of those criteria.

Here is the current formula I have that has TWO criteria, and it works if I delete one of those two, both of them, it will populate everything as intended. But as soon as I add a third criteria, for user status, it breaks the formula.

Formula w/ 2 (Working):
=IFERROR(FILTER(AMTAGS[Assignment],IF(B3<>"",AMTAGS[Assignment Type]=B3,AMTAGS[Assignment Type]<>"")*IF(B5<>"",AMTAGS[Product Type]=B5,AMTAGS[Product Type]<>"")),"")

Formula w/ 3 (Not Working):
=IFERROR(FILTER(AMTAGS[Assignment],IF(B3<>"",AMTAGS[Assignment Type]=B3,AMTAGS[Assignment Type]<>"")*IF(B4<>"",AMTAGS[Staff Status]=B4,AMTAGS[Staff Status]<>"")*IF(B5<>"",AMTAGS[Product Type]=B5,AMTAGS[Product Type]<>"")),"")

Can anyone please help me to figure out what is going wrong?
 

Attachments

  • Capture.JPG
    Capture.JPG
    43.1 KB · Views: 12

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
But as soon as I add a third criteria, for user status, it breaks the formula.
It's not clear what "breaks the formula" means. And your screenshot doesn't match your description.

Can you please explain in more detail, preferably providing an example to illustrate, using XL2BB - Excel Range to BBCode

By the way, this construction: IF(B3<>"",AMTAGS[Assignment Type]=B3,AMTAGS[Assignment Type]<>"") is filtering only non-blanks. If you want all values, including blanks, returned when no filter is specified, you could simplify your formula to:

=FILTER(AMTAGS[Assignment],IF(B3="",1,AMTAGS[Assignment Type]=B3)*IF(B5="",1,AMTAGS[Product Type]=B5)*IF(B4="",1,AMTAGS[Staff Status]=B4),"")
 
Upvote 0
Stephen, your correction and simplification fixed it. Thank you so much!
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,178
Members
452,615
Latest member
bogeys2birdies

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