Dynamic Filter Syntax Assistance

shellp

Board Regular
Joined
Jul 7, 2010
Messages
217
Office Version
  1. 365
  2. 2021
  3. 2010
  4. 2007
Platform
  1. Windows
Hello,

I want to create filter formulae dynamically based on values in cells in the worksheet. The formula below works to filter [Fiscal Year] to the value in C4:
Excel Formula:
Filter(raw_All, Indirect("raw_All[Fiscal Year]")=""&C4)

But what if I want the equal sign (=) to also be dynamic i.e. in B4 where the = or <> would be present in the above formula - what is the syntax? What if I want [Fiscal Year] to be dynamic based on a column name in C5 and how does that impact the formula above?

Any and all assistance greatly appreciated.
 
Hello,

Not sure if I need to note this, but at the thread linked above, I've uploaded a sample workbook to show what I've done and what I would like assistance on for the results. Thanks.

Shelley
 
Upvote 0
Below is the correct syntax that I received from the cross post above:

Excel Formula:
=LET(d,CHOOSECOLS(FILTER(raw_All,(IF(Summary!D4="All",raw_All[Fiscal Year]<>"",raw_All[Fiscal Year]=Summary!D4))*(IF(Summary!D6="All",raw_All[Month]<>"",TEXT(raw_All[Month],"MMMM")=Summary!D6))*(IF(Summary!D8="All",raw_All[DOW]<>"",raw_All[DOW]=Summary!D8))*(IF(Summary!H4="All",raw_All[campus]<>"",raw_All[campus]=Summary!H4))*(IF(Summary!H6="All",raw_All[Gender]<>"",raw_All[Gender]=Summary!H6))*(IF(Summary!H8="All",raw_All[AgeGroup]<>"",raw_All[AgeGroup]=Summary!H8))*(IF(Summary!K4="All",raw_All[Marital_Status_Desc]<>"",raw_All[Marital_Status_Desc]=Summary!K4))*(IF(Summary!K6="All",raw_All[AdmFromDesc]<>"",raw_All[AdmFromDesc]=Summary!K6))*(IF(Summary!K8="All",raw_All[Disposition]<>"",raw_All[Disposition]=Summary!K8))*(raw_All[Fall_Visit]>0)),Summary!$F$13,Summary!$F$15,Summary!$F$17,11),

c,COLUMNS(d),

GROUPBY(TAKE(d,,c-1),TAKE(d,,-1),SUM))
 
Upvote 0
Solution

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