我需要按M列对I3单元格中的查询正确排序
我有这个公式
=ArrayFormula(IFERROR(QUERY({
IFERROR(QUERY({A3:G},"Select Col1,Col2,Col3,'30',Col5 where Col5 contains 'Days' Label '30' '' ",0),{"","","","",""});
IFERROR(QUERY({A3:G},"Select Col1,Col2,Col3,'60',Col6 where Col6 contains 'Days' Label '60' '' ",0),{"","","","",""});
IFERROR(QUERY({A3:G},"Select Col1,Col2,Col3,'90',Col7 where Col7 contains 'Days' Label '90' '' ",0),{"","","","",""})},
"Select * where Col1 is not null order by Col5",0),""))
我已经尝试了好几个小时没有运气
我根据需要制作了一个标签,预期结果
答案 0 :(得分:0)
19 Days
之前的2 Days
为1 <2 Days
,您的查询将正常运行。=ArrayFormula(IFERROR(QUERY({
IFERROR(QUERY({A3:G},"Select Col1,Col2,Col3,'30',Col5 where Col5 contains 'Days' Label '30' '' ",0),{"","","","",""});
IFERROR(QUERY({A3:G},"Select Col1,Col2,Col3,'60',Col6 where Col6 contains 'Days' Label '60' '' ",0),{"","","","",""});
IFERROR(QUERY({A3:G},"Select Col1,Col2,Col3,'90',Col7 where Col7 contains 'Days' Label '90' '' ",0),{"","","","",""})},
"Select Col1,Col2,Col3,Col4,Col5 where Col1 is not null format Col5 '0 Days' order by Col5",0),""))
Days
应该以2或3位数字输入:19 Days
和02 Days
。 答案 1 :(得分:0)
=ARRAYFORMULA(QUERY({IFERROR(QUERY({
IFERROR(QUERY({A3:G},"select Col1,Col2,Col3,'30',Col5 where Col5 contains 'Days' Label '30' '' ",0),{"","","","",""});
IFERROR(QUERY({A3:G},"select Col1,Col2,Col3,'60',Col6 where Col6 contains 'Days' Label '60' '' ",0),{"","","","",""});
IFERROR(QUERY({A3:G},"select Col1,Col2,Col3,'90',Col7 where Col7 contains 'Days' Label '90' '' ",0),{"","","","",""})},
"Select * where Col1 is not null",0),""),
VALUE(REGEXEXTRACT(IFERROR(QUERY({
IFERROR(QUERY({A3:G},"select Col1,Col2,Col3,'30',Col5 where Col5 contains 'Days' Label '30' '' ",0),{"","","","",""});
IFERROR(QUERY({A3:G},"select Col1,Col2,Col3,'60',Col6 where Col6 contains 'Days' Label '60' '' ",0),{"","","","",""});
IFERROR(QUERY({A3:G},"select Col1,Col2,Col3,'90',Col7 where Col7 contains 'Days' Label '90' '' ",0),{"","","","",""})},
"Select Col5 where Col1 is not null",0),""),"\d+"))}, "select Col1,Col2,Col3,Col4,Col5 order by Col6"))