简体   繁体   English

计算公式填充的单元格的平均值

[英]Calculate the average of a cell populated by a formula

I have cells D5, G5, J5 and M5 are being calculated by =imdiv(A5, B5) = D5 , for each of their respective cells. 我有单元格D5,G5,J5和M5,分别由=imdiv(A5, B5) = D5计算得出。 I want to create a formula to calculate the average of D5, G5, J5 and M5. 我想创建一个公式来计算D5,G5,J5和M5的平均值。 I've tried using =average(D5, G5, J5, M5) and =subtotal(101, D5, G5, J5, M5) but both are returning a divide by zero error. 我试过使用=average(D5, G5, J5, M5)=subtotal(101, D5, G5, J5, M5)但都返回零除错误。 Thanks for the help! 谢谢您的帮助!

That is because IMDIV() is giving you a String . 这是因为IMDIV()给您一个String See: 看到:

Aspelin's Answer 阿斯佩林的答案

Since you can't average with the forumula it seems, and you know how many cells you have. 由于您无法平均使用论坛,因此您知道自己有多少个单元格。 Just set a cell, let's say F5 as where the average is. 只需设置一个单元格,假设F5为平均值。

Then in the cell you can simply do =(D5+G5+J5+M5)/4 , and this will give you the average of the four values. 然后,您可以在单元格中简单地进行=(D5+G5+J5+M5)/4 ,这将为您提供四个值的平均值。

Or, if you don't know the amount of cells, you can do D5 = value((imdiv(A5, B5))) (gets value of the number from string) And then doing this for each of the cells, you can then take the average using =average(..) 或者,如果您不知道单元格的数量,则可以执行D5 = value((imdiv(A5, B5))) (从字符串中获取数字的值),然后对每个单元格执行此操作然后使用=average(..)取平均值

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

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