简体   繁体   English

Excel中的平均公式

[英]Average formula in Excel

I'm working on a spreadsheet and I need to have a set of cells ignored if they are blank.我正在处理一个电子表格,如果它们是空白的,我需要忽略一组单元格。 I tried a regular average formula as well as if statements and nothing seems to be working.我尝试了常规平均公式以及 if 语句,但似乎没有任何效果。 The values need to be adjusted so they come to a common value.需要调整这些值,使它们达到一个共同的值。 Here is the formula I am trying to use to calculate the average.这是我试图用来计算平均值的公式。

=(AVERAGE(D4,(F4*0.6),(H4*(6/7))))

This formula will calculate the average but is not ignoring cells that do not have a value.此公式将计算平均值,但不会忽略没有值的单元格。

Excel should automatically ignore truly blank cells when using the =Average() formula.使用=Average()公式时,Excel 应自动忽略真正的空白单元格。 However, if you do have some "0" data or space characters, you could use the following to find the average of anything that is numeric:但是,如果您确实有一些"0"数据或空格字符,则可以使用以下内容来查找任何数字的平均值:

=SUM(A:A)/COUNT(A:A)

Where A:A is your range.其中A:A是您的范围。


EDIT: Simplified to use Count which only finds numeric cells .编辑:简化为使用仅查找数字单元格的Count


EDIT 2: Given your specific example, the average function could look as follows:编辑 2:鉴于您的具体示例,平均函数可能如下所示:

=IFERROR((D4 + (F4*0.6) + (H4*(6/7)))/COUNTA(D4,F4,H4), 0)

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

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