Improve calculation speed for this worksheet with INDIRECT/FILTER functions

GeneBF

New Member
Joined
Jun 28, 2022
Messages
35
Office Version
  1. 365
Platform
  1. Windows
Hello, Im currently looking to improve the calculation speed of my worksheet either through formula optimization or alternative formulas (No complicated VBA or PQuery).

I have a workbook "File A" that contains Tabs "Main" and "01" through "19". "Main" Tab is an interface which includes dropdowns that functions as filters mainly which Tab from "01" through "19" to use, and further filter down each data on each specific tab. Furthermore there will be a workbook "Main File" that will then have a filter on which excel file to use ("File A", "File B", and so on...) on a sharepoint folder.

On "File A" tabs "01" through "19" - I have the following formula (attached below is for Minimum 'rate', other columns contains max, ave, mean, and data count). I've only use LET to lable each range as a handful of people will also edit this and not that familiar or comfortable with large formulas, so for easier understanding and tracking I've input it in LET Function. I also used BYROW to return an array and prevent other people from accidentally editing the formula and a lot of rows will be inserted in between so this also eliminates copy-pasting the formula. Filters set from H5, H6, H7, H9, K10, and K11 are linked on "Main" Tab. "Main" Tab will then pick up this values (Min, Max, Ave, Mean, Count) based on selected Tab on one of the filters.
Code:
=LET(
           ProjectFilter,$H$5,           AssetTypeFilter,$H$6,
           StageFilter,$H$7,              RateTypeFilter,$H$9,
           DateFrom,$K$10,             DateTo,$K$11,
           InflatedRates,$M$15:$CP$15,  ProjectDate,$M$11:$CP$11,
           ProjectRateType,$M$9:$CP$9, ProjectName,$M$5:$CP$5,
           ProjectAsset,$M$6:$CP$6,       ProjectStage,$M$7:$CP$7,

           Formula,

           BYROW($M$17:$CP$300,
                       LAMBDA(R,MINIFS(R,
                                          InflatedRates,"Inflated Rate",
                                          ProjectDate,">="&DateFrom,
                                          ProjectDate,"<="&DateTo,
                                          ProjectRateType,IF(RateTypeFilter="All","*","*"&RateTypeFilter&"*"),
                                          ProjectName,IF(ProjectFilter="All","*","*"&ProjectFilter&"*"),
                                          ProjectAsset,IF(AssetTypeFilter="All","*","*"&AssetTypeFilter&"*"),
                                          ProjectStage,IF(StageFilter="All","<>0",StageFilter)))),
IF(Formula=0,"",Formula))


On "File A" tabs "Main" Tab - I have this formula to pick up the values resulting on the formula above. Cell C5 contains the dropdown for Tab Filter.

Code:
=LET(
             inD,INDIRECT($C$5&"!D1:D500"),       inB,INDIRECT($C$5&"!B1:B500"),
             inJ,INDIRECT($C$5&"!J1:J500"),           inC,INDIRECT($C$5&"!C1:C500"),

IFS($E$6="ALL",(FILTER(inD,((LEFT(inB,1)="I")*(inJ<>"")))),
$E$7="All",(FILTER(inD,(NOT(ISERR(SEARCH("I."&RIGHT(XLOOKUP($E$6,inC,(inB)),1),inB,1))))*(inJ<>""))),
$E$8="All",(FILTER(inD,(NOT(ISERR(SEARCH("I."&RIGHT(XLOOKUP($E$7,inC,(inB)),3),inB,1))))*(inJ<>""))),
TRUE,(FILTER(inD,((inC=$E$8)*(inJ<>""))))))

This will be then picked up again by a Main Separate File that will contain a filter which chooses which file to be linked on with formula below

Code:
=LET(
          link,"'https://sharepoint-link-here/[",
          sector,Main!$D$5,
          filetype,".xlsb]",
         formula,INDIRECT(link&sector&filetype&"Main'!D16#"),

IF(OR(formula="",formula=0),"",formula))

Some of the ways I can think of are:
1. Have the formula be in "Main Tab" only instead of 01 through 19, having a long indirect formula on one tab, instead of having multiple long formulas on each tab.
2. Set the calculation to manual, and include a VBA code to only calculate the selected tab in filter instead of recalculating the whole sheet every time (??? not really sure about this, just a thought trial)

Any suggestions will be appreciated, thank you!
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

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