Google apps script 将google工作表公式转换为自定义函数

Google apps script 将google工作表公式转换为自定义函数,google-apps-script,google-sheets,custom-function,Google Apps Script,Google Sheets,Custom Function,这是一个真正的工作公式在我的谷歌表。我有5个单元格,用户从数据验证下拉列表中选择值。然后,此公式选择要过滤的图纸,然后根据这些值进行过滤。显然,我的问题是速度。所以我希望,如果我创建一个或多个自定义函数,我将提高我的计算性能。我的问题是,最好的办法是什么。创建一个函数,或者我应该将其分解为不同的函数,并从多个自定义函数构建公式。我会看到进步吗?我还考虑在用户单击图像按钮之前不设置公式(以避免在用户选择时公式不断重新计算) =if(E4=“查看所有联系人”,过滤器('View All Contac

这是一个真正的工作公式在我的谷歌表。我有5个单元格,用户从数据验证下拉列表中选择值。然后,此公式选择要过滤的图纸,然后根据这些值进行过滤。显然,我的问题是速度。所以我希望,如果我创建一个或多个自定义函数,我将提高我的计算性能。我的问题是,最好的办法是什么。创建一个函数,或者我应该将其分解为不同的函数,并从多个自定义函数构建公式。我会看到进步吗?我还考虑在用户单击图像按钮之前不设置公式(以避免在用户选择时公式不断重新计算)

=if(E4=“查看所有联系人”,过滤器('View All Contacts'!$A$1:$L$3999,if(I8)”“查看所有联系人”!A:A=I8,'View All Contacts'!A:A”“),if(E7“”“查看所有联系人”!M:M=E7,'View All Contacts'!A:A”“),if(E9“”“查看所有联系人”!O:O=E9,if(E8=“所有千里石纪念日”,('View All Mile Stone annories'!N:N=(year(NOW))-1))+(‘查看所有联系人’!N:N=(年(现在())-5))+(‘查看所有联系人’!N:N=(年(现在())-10))+(‘查看所有联系人’!N:N=(年(现在())-15))+(‘查看所有联系人’!N:N=(年(现在())-20))+(‘查看所有联系人’!N:N=(年(现在())-25))+(‘查看所有联系人’!N:N=(年(现在())-30))(‘查看所有联系人’!N:N=(年(现在())-40))+(‘查看所有联系人’!N:N=(年(现在())-50))+(‘查看所有联系人’!N:N=(年(现在())-60))+(‘查看所有联系人’!N:N=(年(现在())-70))+(‘查看所有联系人’!N:N=(年(现在())-75))+(‘查看所有联系人’!N:N=(年(现在())-80))+(‘查看所有联系人’!N:N=(年(现在())-90))(‘查看所有联系人’!N:N=(年(现在())-100))+('View All Contacts'!N:N=(year(Now())-125))+('View All Contacts'!N:N=(year(Now())-150))+('View All Contacts'!N:N=(year(Now())-175))+('View All Contacts'!N:N=(year(Now())-200)),If(E8=“>100”,“View All Contacts”!N:N<(year(year(Now())-100)*('View All Contacts)(查看所有联系人)!N:N”“),If(E8>0),'View All Contacts'!N:N=(year(Now())-E8),“查看所有联系人”!A:A“;”)),如果(E4=“查看活动联系人”,过滤器('View Active Contacts'!$A$1:$L$3999,如果(I8”,“查看活动联系人”!A:A=I8,“查看活动联系人”!A:A“”),如果(E7”,“查看活动联系人”!M:M=E7,“查看活动联系人”!A:A“”),如果(E9”,“查看活动联系人”!O:E9,如果(E8=“所有里程石纪念日”,(‘查看活动联系人’!N:N=(年(现在())-1))+(‘查看活动联系人’!N:N=(年(现在())-5))+(‘查看活动联系人’!N:N=(年(现在())-10))+(‘查看活动联系人’!N:N=(年(现在())-15))+(‘查看活动联系人’!N:N=(年(现在())-20))+(‘查看活动联系人’!N:N=(年(现在())-25))(‘查看活动联系人’(年(现在())-30)+(‘查看活动联系人’!N:N=(年(现在())-40))+(‘查看活动联系人’!N:N=(年(现在())-50))+(‘查看活动联系人’!N:N=(年(现在())-60))+(‘查看活动联系人’!N:N=(年(现在())-70))+(‘查看活动联系人’!N:N=(年(现在())-75))+(‘查看活动联系人’!N:N=(年(现在())-80))+(‘查看活动联系人’!N:N=(年(现在())-90))+(‘查看活动联系人’!N:N=(年(现在())-100))+(‘查看活动联系人’!N:N=(年(现在())-125))+(‘查看活动联系人’!N:N=(年(现在())-150))+(‘查看活动联系人’!N:N=(年(现在())-175))+(‘查看活动联系人’!N:N=(年(现在())-200)),如果(E8=“>100”,('View Active Contacts'!N:N<(year(Now())-100)*('View Active Contacts'!N:N''),如果(E8>0,'View Active Contacts'!N:N=(year(Now())-E8),'View Active Contacts'!A:A”“)))),如果(E4=(查看公司待付款的联系人),过滤器('View Contacts from Companies Pending Current payment payment'!$A$1:$L$3999,如果(I8“”,“查看待付款公司的联系人”!A:A=I8,“查看待付款公司的联系人”!A:A“”),如果(E7),“查看待付款公司的联系人”!M:M=E7,“查看待付款公司的联系人”!A:A“”),如果(E9),“查看待付款公司的联系人”!O:O=E9,如果(E8=“所有迈尔斯通周年纪念日”(“查看公司待付款的联系人”!N:N=(年(现在())-1))+(“查看公司待付款的联系人”!N:N=(年(现在())-5))+(“查看公司待付款的联系人”!N:N=(年(现在())-10))+('View Contacts from companys Pending Current payment'!N:N=(year(Now())-15))+('View Contacts from companys Pending Current payment'!N:N=(year(Now())-20))+('View Contacts from companys Pending Current payment'!N:N=(year(Now())-30))+('View Contacts from companys Pending Current payment'!N:N=(year(Now())-40))+('View Contacts from companys Pending Current payment'!N:N=(year(Now())-50))+('View Contacts from companys Pending Current payment'!N:N=(year(Now())-70))+('View Contacts from companys Pending Current payment'!N:N=(year(Now())-75))+('View Contacts from companys Pending Current payment'!N:N=(year(Now())-80))+('View Contacts from companys Pending Current payment'!N:N=(year(Now())-100))+('View Contacts from companys Pending Current payment'!N:N=(year(Now())-125))+('View Contacts from companys Pending Current Payments'!N:N=(year(Now())-125))+('View Contacts from companys Pending Current Payments'!N:N=(year(Now())-150))+('View Contacts from companys Pending Current Payments Pending Current Payments(Now())-175))+(如果(E8=“>100”,(“查看待付款公司的联系人”!N:N<(年份(现在())-100)*(“查看公司的联系人
if (E4=C2, filter(FilterRange,C2) 
if(E4= C2, filter(vlookup(FilterRange,C2,2)...