Use a cell reference to update a filter command

lionelR61

New Member
Joined
May 10, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Good afternoon,
I need to be able to change the filter range by referencing a single cell BN2 = [Jan 23].
The difficulty is the table reference, FeesInvoice[ x ]

(Cell Reference BM4) =FILTER(FeesInvoiced[Project Number],FeesInvoiced[Jan-22]<>0)
(Cell Reference BN4) =FILTER(FeesInvoiced[Jan-22],FeesInvoiced[Jan-22]<>0)

Jan-22 needs to be dynamic, I cannot get the syntax correct.
Any assistance would be appreciated.
 

Attachments

  • filter reference.JPG
    filter reference.JPG
    48.9 KB · Views: 11

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
As the headers in the table will be text but the value in BN3 could be a date as Excel would format Jan-23 as a date on my machine the below may help:
Excel Formula:
=FILTER(FeesInvoiced[Project Number],INDEX(FeesInvoiced,,MATCH(TEXT($BN$3,"mmm-yy"),FeesInvoiced[#Headers],))<>0)
 
Upvote 0
Georgiboy, thank you very much that is excellent logic.
I am however struggling with geting the account values in the second column, what is the syntex for moving across the table to column 'Jan 22"

=FILTER(FeesInvoiced[Jan-22],FeesInvoiced[Jan-22]<>0)

Apologies if it is obvious
 
Upvote 0
I tried this but errored
=FILTER(FeesInvoiced,MATCH(TEXT($BN$3,"mmm-yy"),FeesInvoiced,MATCH(TEXT($BN$3,"mmm-yy")),<>0))
 
Upvote 0
The 0 just before the <>0 needs to be added to the first formula:
Excel Formula:
=FILTER(FeesInvoiced[Project Number],INDEX(FeesInvoiced,,MATCH(TEXT($BN$3,"mmm-yy"),FeesInvoiced[#Headers],0))<>0)

Maybe the below for the second:
Excel Formula:
=let(c,INDEX(FeesInvoiced,,MATCH(TEXT($BN$3,"mmm-yy"),FeesInvoiced[#Headers],0)),filter(c,c<>0))
 
Upvote 0
Solution

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

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