+ Reply to Thread
Results 1 to 4 of 4

Not quite the average problem with the average function

  1. #1
    Registered User
    Join Date
    05-22-2008
    Posts
    6

    Not quite the average problem with the average function

    Hi, I'm averaging values (1,2,3 or 4) from 3 contiguous cells in a row; I'd like to be able to ignore blank cells and where all three are blank, to return zero. This is the problem as when all 3 cells are blank, using the simple function AVERAGE it returns the error message not divisible by zero (#DIV/0!).

    I would then like to average the averages at the bottom of the column which i do with following:

    I'm able to ignore zero values (see below)

    =AVERAGE(IF(G6:G15<>0,G6:G15))

    This ignores zero fine but when I have the error message it doesn't work of course.

    I wondered if there was a way of ignoring both blank and zero when using the average function.

    I'm getting all mixed up going around and around in circles solving one part of the problem but not the other.

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Try this

    =SUM(A1:A10)/MAX(1,COUNT(A1:A10)-COUNTIF(A1:A10,0))
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Hi Barry,

    Excel should not be including true blanks in your averages so that shouldn't be a problem. With your initial averages, I'd suggest
    Please Login or Register  to view this content.
    In place of the double quotes you could also use text (e.g. "No Values") which, as text, also would not be averaged.
    Your Average of the Averages formula should then work. Let us know if there is more to this problem than I assumed.

    ChemistB

  4. #4
    Registered User
    Join Date
    05-22-2008
    Posts
    6

    Genius

    Hi to you both - first of all thanks for th espeedy reply but most of all for the solutions, both of which work; so now I have a new problem - which one shall I use.

    Many thanks - I can't believe how many hours I've worked on this. I feel very humble.

    Barry

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1