Horizontal Filters

tinferns

Board Regular
Joined
Aug 18, 2009
Messages
150
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hello Team,
Firstly thanks a million for all your help in the past.

I need your help on the below:

I prefer formula(s), but I guess this will work best with a VBA. In the below table, I want to apply a horizontal filter based on Week Number. So If I have selected Week 41, I want to see all 6 departments' dates between 05Oct2020 - 09Oct2020. Rest has to be hidden.

If required can place another table in the file to help VBA choose START DATE & END DATE depending on Year and Week Number. The format I am working is shown below:

VBA FOR HORIZONTAL FILTER.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBI
1Week NoDepartment 1Department 2Department 3Department 4Department 5Department 6Department 1Department 2Department 3Department 4Department 5Department 6
24105-Oct06-Oct07-Oct08-Oct09-Oct05-Oct06-Oct07-Oct08-Oct09-Oct05-Oct06-Oct07-Oct08-Oct09-Oct05-Oct06-Oct07-Oct08-Oct09-Oct05-Oct06-Oct07-Oct08-Oct09-Oct05-Oct06-Oct07-Oct08-Oct09-Oct12-Oct13-Oct14-Oct15-Oct16-Oct12-Oct13-Oct14-Oct15-Oct16-Oct12-Oct13-Oct14-Oct15-Oct16-Oct12-Oct13-Oct14-Oct15-Oct16-Oct12-Oct13-Oct14-Oct15-Oct16-Oct12-Oct13-Oct14-Oct15-Oct16-Oct
3Number of Emplooyes
4Employees Present
5Employees Absent
6
7Total Productivity
8Expected Productivity
9Actual Producitivty
10Difference
11
12Quality Scores
13Expected QA Scores
14Difference
15
16Client Scores
17Expected Client Scores
18Difference
19
Sheet1


Start Date and End Date based on Year and Week Number (I can keep this table hidden somewhere in the sheet)
VBA FOR HORIZONTAL FILTER.xlsx
ABCD
21YearWeek NoStart DateEnd Date
222020415-Oct-209-Oct-20
2320204212-Oct-2016-Oct-20
2420204319-Oct-2023-Oct-20
2520204426-Oct-2030-Oct-20
262020452-Nov-206-Nov-20
272020469-Nov-2013-Nov-20
2820204716-Nov-2020-Nov-20
2920204823-Nov-2027-Nov-20
3020204930-Nov-204-Dec-20
312020507-Dec-2011-Dec-20
3220205114-Dec-2018-Dec-20
3320205221-Dec-2025-Dec-20
3420205328-Dec-201-Jan-21
35202114-Jan-218-Jan-21
362021211-Jan-2115-Jan-21
372021318-Jan-2122-Jan-21
382021425-Jan-2129-Jan-21
39202151-Feb-215-Feb-21
40202168-Feb-2112-Feb-21
412021715-Feb-2119-Feb-21
422021822-Feb-2126-Feb-21
43202191-Mar-215-Mar-21
442021108-Mar-2112-Mar-21
4520211115-Mar-2119-Mar-21
4620211222-Mar-2126-Mar-21
4720211329-Mar-212-Apr-21
482021145-Apr-219-Apr-21
4920211512-Apr-2116-Apr-21
5020211619-Apr-2123-Apr-21
5120211726-Apr-2130-Apr-21
522021183-May-217-May-21
5320211910-May-2114-May-21
5420212017-May-2121-May-21
5520212124-May-2128-May-21
5620212231-May-214-Jun-21
572021237-Jun-2111-Jun-21
5820212414-Jun-2118-Jun-21
5920212521-Jun-2125-Jun-21
6020212628-Jun-212-Jul-21
612021275-Jul-219-Jul-21
6220212812-Jul-2116-Jul-21
6320212919-Jul-2123-Jul-21
6420213026-Jul-2130-Jul-21
652021312-Aug-216-Aug-21
662021329-Aug-2113-Aug-21
6720213316-Aug-2120-Aug-21
6820213423-Aug-2127-Aug-21
6920213530-Aug-213-Sep-21
702021366-Sep-2110-Sep-21
7120213713-Sep-2117-Sep-21
7220213820-Sep-2124-Sep-21
7320213927-Sep-211-Oct-21
742021404-Oct-218-Oct-21
7520214111-Oct-2115-Oct-21
7620214218-Oct-2122-Oct-21
7720214325-Oct-2129-Oct-21
782021441-Nov-215-Nov-21
792021458-Nov-2112-Nov-21
8020214615-Nov-2119-Nov-21
8120214722-Nov-2126-Nov-21
8220214829-Nov-213-Dec-21
832021496-Dec-2110-Dec-21
8420215013-Dec-2117-Dec-21
8520215120-Dec-2124-Dec-21
8620215227-Dec-2131-Dec-21
87202213-Jan-227-Jan-22
882022210-Jan-2214-Jan-22
Sheet1
Cell Formulas
RangeFormula
C22:C88C22=DATE(A22,1,-2)-WEEKDAY(DATE(A22,1,3))+B22*7
D22:D88D22=DATE(A22, 1, -2) - WEEKDAY(DATE(A22, 1, 3)) + B22 * 7 + 4
 
Hi Jason.. Thanks for all your efforts.. but I am sorry to say that it is still not working. As suggested by you I closed all Excel files and opened them, yet it does not seem to work. Screenshots should help you find my mistakes.

Thanks..
 

Attachments

  • Horizontal Filter.jpg
    Horizontal Filter.jpg
    185 KB · Views: 3
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
close excel and reopen it
Close excel, not close the files. If you close the files and keep the program open then it doesn't reset.

It works fine for me with the sample from post 1.
 
Upvote 0
Thanks Jason.. it worked.. Thanks a million.. Cheers....
 
Upvote 0

Forum statistics

Threads
1,214,654
Messages
6,120,758
Members
448,991
Latest member
Hanakoro

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