简体   繁体   English

谷歌工作表查询错误 AVG_SUM_ONLY_NUMERIC

[英]google sheet query error AVG_SUM_ONLY_NUMERIC

Hi I use this query formula in google sheet and it works good as long as there is values in column E,F,G.您好,我在 google 表格中使用了这个查询公式,只要 E、F、G 列中有值,它就可以正常工作。

=Query('CM Invoice Report':A10,G,"Select C,Sum(E),Sum(F),Sum(G) where C is not null Group By C Label C'', Sum(E)'', Sum(F)'', Sum(G)''" ,0) =Query('CM Invoice Report':A10,G,"Select C,Sum(E),Sum(F),Sum(G) where C is not null Group By C Label C'', Sum(E)'', Sum(F)'', Sum(G)''" ,0)

The problem is if one of the column as no value I get #VALUE AVG_SUM_ONLY_NUMERIC error so I tried adding an iferror to the formula as suggested in many post but I just can't seem to get it to work.问题是,如果其中一列没有值,我会收到#VALUE AVG_SUM_ONLY_NUMERIC错误,所以我尝试按照许多帖子中的建议向公式中添加一个 iferror,但我似乎无法让它工作。 PS.附言。 I've also tried replacing column C,E,F,G with Col3,Col5,Col6,Col7 and still nothing.我也尝试用 Col3、Col5、Col6、Col7 替换列 C,E,F,G,但仍然没有。 Here's the other formula I've tried.这是我试过的另一个公式。

=Query({Iferror(query('CM Invoice Report':A10,G,"Select C,Sum(E),Sum(F),Sum(G) where C is not null Group By (C) Label C'', Sum(E)'', Sum(F)'', Sum(G)''",0),{"","","",""})})

Any help would be greatly appreciated任何帮助将不胜感激

It's possible that in one of the columns you have many text values?有可能在其中一列中有很多文本值吗? If that's so, QUERY is possibly handling that column as text, considering the actual numbers as text.如果是这样,QUERY 可能将该列作为文本处理,将实际数字视为文本。 You may try converting them to its numeric value;您可以尝试将它们转换为数值; IFERROR will exclude those that are really text: IFERROR 将排除那些真正的文本:

=Query({'CM Invoice Report'!C10:C,INDEX(IFERROR(VALUE('CM Invoice Report'!E10:G)))},"Select Col1,Sum(Col2),Sum(Col3),Sum(Col4) where Col1 is not null Group By Col1 Label Col1 '', Sum(Col2) '', Sum(Col3)'', Sum(Col4)''",0)

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

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