简体   繁体   English

将 Google 表格过滤器公式转换为 Excel 2016

[英]Converting a Google Sheets Filter Formula to Excel 2016

I need convert a sheet I built in google sheets to Excel 2016 since my team does not know google sheets.我需要将我在 google 表格中构建的表格转换为 Excel 2016,因为我的团队不知道 google 表格。 I wrote a formula to check multiple columns and then build a new array from any data in the selected columns.我编写了一个公式来检查多列,然后从选定列中的任何数据构建一个新数组。 I understand filter is not available in Excel 2016 but unfortunately upgrading is not a viable option for the whole organization.我知道过滤器在 Excel 2016 中不可用,但不幸的是,升级对于整个组织来说不是一个可行的选择。

The formula I need help converting is我需要帮助转换的公式是

=sort({iferror(FILTER('3)ReAllocation Holdings'!$D$3:$E,'3)ReAllocation Holdings'!$D$3:$D<>""),{"",""});
iferror(FILTER('3)ReAllocation Holdings'!$F$3:$G,'3)ReAllocation Holdings'!$F$3:$F<>""),{"",""});
iferror(FILTER('3)ReAllocation Holdings'!$H$3:$I,'3)ReAllocation Holdings'!$H$3:$H<>""),{"",""});
iferror(FILTER('3)ReAllocation Holdings'!$J$3:$K,'3)ReAllocation Holdings'!$J$3:$J<>""),{"",""});
iferror(FILTER('3)ReAllocation Holdings'!$L$3:$M,'3)ReAllocation Holdings'!$L$3:$L<>""),{"",""});
iferror(FILTER('3)ReAllocation Holdings'!$N$3:$O,'3)ReAllocation Holdings'!$N$3:$N<>""),{"",""});
iferror(FILTER('3)ReAllocation Holdings'!$P$3:$Q,'3)ReAllocation Holdings'!$P$3:$P<>""),{"",""});
iferror(FILTER('3)ReAllocation Holdings'!$R$3:$S,'3)ReAllocation Holdings'!$R$3:$R<>""),{"",""})
},1,0)

The filters checked all 8 columns for data and returned all data in the 8 columns and the column next to it.过滤器检查所有 8 列的数据并返回 8 列及其旁边的列中的所有数据。 Then I was sorting the data since I was using an array litteral each column had to provide some data, so the iferror was providing blank,blank if the column was empty and then the sort put those to the bottom.然后我对数据进行排序,因为我使用的是数组,每列必须提供一些数据,所以 iferror 提供空白,如果该列为空,则为空白,然后排序将它们放在底部。

Any help would be greatly appreciated.任何帮助将不胜感激。 I don't really know excel but I know google sheets really well so I'm open to any level of complexity for a solution.我不太了解 excel,但我非常了解 google 表格,所以我愿意接受任何复杂程度的解决方案。

I managed to get a similar thing as the stacking filter using AGGREGATE it will list all data if the left column contains a value:我设法获得了与使用 AGGREGATE 的堆叠过滤器类似的东西,如果左列包含一个值,它将列出所有数据:

(Enter with ctrl+shift+enter , copied down and one cell to the right) (使用ctrl+shift+enter ,向下复制,向右一个单元格)

=IFERROR(INDEX(D$1:D$5,AGGREGATE(15,6,ROW($D$1:$D$5)/($D$1:$D$5<>""),ROW($A1))),
 IFERROR(INDEX(F$1:F$5,AGGREGATE(15,6,ROW($F$1:$F$5)/($F$1:$F$5<>""),ROW($A1)-COUNTA($D$1:$D$5))), 
 IFERROR(INDEX(H$1:H$5,AGGREGATE(15,6,ROW($H$1:$H$5)/($H$1:$H$5<>""),ROW($A1)-COUNTA($D$1:$D$5,$F$1:$F$5))),
 
 IFERROR(INDEX(J$1:J$5,AGGREGATE(15,6,ROW($J$1:$J$5)/($J$1:$J$5<>""),ROW($A1)-COUNTA($D$1:$D$5,$F$1:$F$5,$H$1:$H$5))), 
 IFERROR(INDEX(L$1:L$5,AGGREGATE(15,6,ROW($L$1:$L$5)/($L$1:$L$5<>""),ROW($A1)-COUNTA($D$1:$D$5,$F$1:$F$5,$H$1:$H$5,$J$1:$J$5))),
 "")))))

在此处输入图像描述

I built it up to column L:L, but from there on you get the idea how the formula repeats and the COUNTA -range is stacked.我将它构建到 L:L 列,但从那里您会了解公式如何重复以及COUNTA -range 是如何堆叠的。

Also the row numbers need to be adjusted to your needs.此外,行号需要根据您的需要进行调整。

It does not have the SORT functionality, but I believe the reason you sort is to get empty lines your array creates sorted to the back?它没有排序功能,但我相信你排序的原因是让你的数组创建的空行排序到后面? Anyway.反正。 If you want to get the outcome sorted it's better to use these as helper cells and use INDEX/AGGREGATE on the row number from small to large.如果您想对结果进行排序,最好将它们用作辅助单元格,并在从小到大的行号上使用 INDEX/AGGREGATE。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM