Share via

excel, average function

Anonymous
2025-02-13T12:48:14+00:00

Hi folks

how do I average(E7,L7,E24,L24,E31,L31) when not all of them will have values yet? ie E7 & L7 are 130 + 127 respectively but the 24's & 31's won't be have values until Mar, Apr, May & June?

There are values in adjoining cells that I don't want in the calc so I'm finding it tricky

Many thx

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Rich~M 20,370 Reputation points Volunteer Moderator
    2025-02-13T18:42:01+00:00

    I suspect that Joeu2004 is correct that the contents of the cells are not as simple as you described. I am assuming now that there are formulas in those cells, probably a SUM function that adds up the intervening rows. If that is the case, then Excel doesn't see those cells as blank which is why it is dividing by 6 rather than by 2. You can use this formula to eliminate the cells that don't have a value yet so that Excel will divide by the correct number.

    =AVERAGE(FILTER(VSTACK(E7,L7,E24,L24,E31,L31),VSTACK(E7,L7,E24,L24,E31,L31)<>0))

    If the formulas in the cells result in "" rather than a 0, change the 0 at the end to "".

    0 comments No comments

9 additional answers

Sort by: Most helpful
  1. HansV 462.6K Reputation points MVP Volunteer Moderator
    2025-02-13T15:21:32+00:00

    If you have only two values, the average is the sum of those two values divided by 2, not by 6. If you divide by 6, you count the missing values as 0.

    If for some reason, you do really want to count the missing values as 6, use

    =SUM(E7,L7,E24,L24,E31,L31)/6

    0 comments No comments
  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Anonymous
    2025-02-13T14:58:04+00:00

    That's what I thought but it's comes back with 43 (rounded). 130+127=257/6. I should be getting 128 (again rounded) Maybe it's because I'm still using 2007

    Thanks for your time anyway

    0 comments No comments
  4. HansV 462.6K Reputation points MVP Volunteer Moderator
    2025-02-13T13:36:29+00:00

    Simply =AVERAGE(E7,L7,E24,L24,E31,L31)

    The AVERAGE function ignores empty cells and cells with text values.

    0 comments No comments