【发布时间】:2015-10-10 14:16:39
【问题描述】:
我计算同一列中一系列行中的值的平均值和标准偏差,但是当列中没有输入值时,例如,我得到“#DIV/0!”在应该出现平均值或标准差的单元格中,那么我该如何解决这个问题,以便我得到消息“未计算”而不是“#DIV/0!”。
这是我在单元格中输入平均公式的方法:
newWorkBook.Worksheets("Feuil1").Range(Cells(29, i + 2).Address()).Formula = "=AVERAGE(" + Cells(19, i + 2).Address() + ":" + Cells(28, i + 2).Address() + ")"
编辑:我试过这个:
newWorkBook.Worksheets("Feuil1").Range(Cells(29, i + 2).Address()).Formula = "=IFERROR(AVERAGE(" + Cells(19, i + 2).Address() + ":" + Cells(28, i + 2).Address() + ")" + "," + "non calculated" + ")"
然后我得到“#NOM?”而不是“非计算”(PS:我使用的是法语版本的 Excel,所以英文可能是“#NAME?”)
【问题讨论】:
-
newWorkBook.Worksheets("Feuil1").Range(Cells(29, i + 2).Address()).Formula = "=IFERROR(AVERAGE(" & Cells(19, i + 2) ).Address() & ":" & Cells(28, i & 2).Address() & ")" & "," & "non computed" & ")" 使用 "&"'s not "+"' s