+ Reply to Thread
Results 1 to 7 of 7

How to NOT take an average if any blank cells

  1. #1
    Registered User
    Join Date
    11-06-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    10

    How to NOT take an average if any blank cells

    I am aware that the Average function does not include blank cells in the calculation, this is not my question.

    I would like to take an average of a row of 4 cells and copy the formula down a LARGE spreadsheet. There are some rows were only 1 or 2 out of the 4 contain any values and I would NOT like to return an average for any of these rows.

    Please help me all you Excel geniuses out there.
    Many thanks

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    wales
    MS-Off Ver
    Excel 2007
    Posts
    964

    Re: How to NOT take an average if any blank cells

    i guess you would use something like this

    =IF(COUNTA(A1:D1)<>4,AVERAGE(A1:D1),"")
    The Importance of INDEX - A GUIDE TO INDEX'S OTHER USES
    <--- If a post helps hit the star

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: How to NOT take an average if any blank cells

    =IF(COUNT(A1:D1)=4,AVERAGE(A1:D1),"")

    will only average if there are numbers in each of the four cells. Copy down as needed.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Registered User
    Join Date
    11-06-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: How to NOT take an average if any blank cells

    Thank you both! Works perfectly with =4. I did not know about the COUNTA function so you have both helped enormously :D

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: How to NOT take an average if any blank cells

    COUNTA will count text values (or spaces), which will give you errors, so you might be better using COUNT in this instance.

    Pete

  6. #6
    Registered User
    Join Date
    11-06-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: How to NOT take an average if any blank cells

    Great, thanks for the extra clarity Pete

  7. #7
    Registered User
    Join Date
    10-13-2014
    Location
    Phoenix, AZ
    MS-Off Ver
    2010
    Posts
    99

    Re: How to NOT take an average if any blank cells

    This works well with rows or columns of cells with zeroes that you don't want to count

    =AverageIF(B1:K1, "<>0")
    I've attached a picture (though I don't know if you can see it) of my sheet with the equation displayed. Hope this helps
    Attached Images Attached Images

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Average non-contiguous cells, ignore blank cells and avoid #DIV/0!
    By Davdef in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 10-06-2018, 10:03 AM
  2. Replies: 10
    Last Post: 04-25-2013, 06:12 PM
  3. Average the last 10 cells of a dynamic column but ignore blank cells & 0
    By mattadler22 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-13-2013, 11:37 PM
  4. [SOLVED] find blank cells in column and average the cells below
    By desibabuji in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-03-2013, 12:03 PM
  5. Find a blank cell and calculate the average of all cells above till the next blank
    By joshnathan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-27-2012, 11:51 AM

Tags for this Thread

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