admin管理员组文章数量:1391987
Overview:
I have an Excel spreadsheet that contains three primary columns that will be utilized to create a main list:
- column E - IN UNIT: Y/N
- column F - COMMON: Y/N
- column G - Product: List of product items
I'm attempting to group the list of items by where IN UNIT = Y, and also if COMMON = Y. I have drafted a formula that contains 2 Filters and stacks the result set vertically.
What I'm struggling with is how can I also include the column headers (IN UNIT and COMMON) to the filtered result set? An example of the desired result is listed below:
=VSTACK(FILTER(Reference!G2:G378, Reference!E2:E378 = "y", Reference!G2:G378),FILTER(Reference!G2:G378, Reference!F2:F378 = "y", Reference!G2:G378))
Further guidance is much appreciated. Thanks
Overview:
I have an Excel spreadsheet that contains three primary columns that will be utilized to create a main list:
- column E - IN UNIT: Y/N
- column F - COMMON: Y/N
- column G - Product: List of product items
I'm attempting to group the list of items by where IN UNIT = Y, and also if COMMON = Y. I have drafted a formula that contains 2 Filters and stacks the result set vertically.
What I'm struggling with is how can I also include the column headers (IN UNIT and COMMON) to the filtered result set? An example of the desired result is listed below:
=VSTACK(FILTER(Reference!G2:G378, Reference!E2:E378 = "y", Reference!G2:G378),FILTER(Reference!G2:G378, Reference!F2:F378 = "y", Reference!G2:G378))
Further guidance is much appreciated. Thanks
Share Improve this question asked Mar 16 at 20:32 Jarvis DavisJarvis Davis 1416 bronze badges 1 |
1 Answer
Reset to default 1I am not sure what exactly you need, maybe is something like this:
Assuming that your data is in table named Table1 with three columns:)
Formula under title Products where [IN UNIT] = "y" or [COMMON] = "y":
=FILTER(Table2[Product],(Table1[IN UNIT]="y")+(Table1[COMMON]="y"))
Formula under title Products where [IN UNIT] = "y" or [COMMON] = "y":
=FILTER(Table2[Product],(Table1[IN UNIT]="y")*(Table1[COMMON]="y"))
Description:
Formula Filter(SelectionRange, CriteriaRange) returns values from a list of values in SelectionRange where element with same index in CriteriaRange = 1 (criteria is matched.
By putting criteria in brackets, you can use multiple criteria and combine them with logical AND or logical OR operators, which are, in case of values 0 or 1, same as multiplication for AND , addition for OR.
Just be sure that each list has the same number of elements.
本文标签: excelHow can I include column headers from another column into a Filtered listStack Overflow
版权声明:本文标题:excel - How can I include column headers from another column into a Filtered list? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744586848a2614247.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
=VSTACK(E1,FILTER(Reference!G2:G378, Reference!E2:E378 = "y"),F1,FILTER(Reference!G2:G378, Reference!F2:F378 = "y"))
? – P.b Commented Mar 16 at 21:09