So I have a template that I am inputting data from a csv into an excel file. The data doesn't always "file the template" so to speak or there are some fields that have '0' in them. What I am trying to do is add a for loop or something of the sort to basically 'throw out' the 0's but still average the cells say BX2-BX50. I would like excel to ignore the 0's when averaging the numbers within those fields.
Any help would be greatly appreciated!
答案 0 :(得分:2)
无需过度思考。 AVERAGEIFS function应该绰绰有余。
=averageifs(BX:BX, BX:BX, "<>0")
答案 1 :(得分:0)
全部 所以你的意思是“0”的行不是数据,只是将它从CSV转换为Excel时的错误行?如果是这样,最好删除这些行,因为如果0显示为正确的数据,它应该会降低整体平均值。你可以消除错误数据,但你不能忽视真实导致错误的结果。
并且对于删除错误零线,您可以使用循环:
var_dump