Google sheets 从多个列和顺序中选择数据
考虑下表Google sheets 从多个列和顺序中选择数据,google-sheets,Google Sheets,考虑下表产品: A B C ... Q 1 product type origin value 2 apple fruit EN 0 3 pear fruit US 5 4 chicken meat DE 7 5 beef meat DE 0 6 cherry fruit US 3
产品:
A B C ... Q
1 product type origin value
2 apple fruit EN 0
3 pear fruit US 5
4 chicken meat DE 7
5 beef meat DE 0
6 cherry fruit US 3
7 orange fruit DE 0
8 peas veg US 2
9 pork meat US 8
10 kale veg DE 4
我想编制一份所有产品的清单:
- 具有值>
0
- 列
产品
,来源
和值
- 按值排序(从高到低)
如下(预期产出):
我知道如何分别获取这3列:
=filter(Products!A$2:A, Products!Q$2:Q<>0)
=filter(Products!C$2:C, Products!Q$2:Q<>0)
=filter(Products!Q$2:Q, Products!Q$2:Q<>0)
=过滤器(产品!A$2:A,产品!Q$2:Q0)
=过滤器(产品!C$2:C,产品!Q$2:Q0)
=过滤器(产品!Q$2:Q,产品!Q$2:Q0)
但这不是命令,我认为效率低下
如何从1公式中获取所需数据,并按所需方式排序?试试:
=QUERY(TRANSPOSE(QUERY(TRANSPOSE(A:C),
"where Col1 matches 'product|origin|value'", 0)),
"where Col3 > 0 order by Col3 desc", 0)
请注意,匹配项
区分大小写
=QUERY(TRANSPOSE(QUERY(TRANSPOSE(A:C),
"where Col1 matches 'product|origin|value'", 0)),
"where Col3 > 0 order by Col3 desc", 0)