MLSplayer
MLSplayer

Reputation: 3

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. I want to create a formula to calculate the average of D5, G5, J5 and 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. Thanks for the help!

Upvotes: 0

Views: 87

Answers (2)

Gary's Student
Gary's Student

Reputation: 96771

That is because IMDIV() is giving you a String. See:

Aspelin's Answer

Upvotes: 2

Rivasa
Rivasa

Reputation: 6750

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.

Then in the cell you can simply do =(D5+G5+J5+M5)/4, and this will give you the average of the four values.

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(..)

Upvotes: 0

Related Questions