+ Reply to Thread
Results 1 to 6 of 6

Divide the sum of a range by the number of non blanks

  1. #1
    Registered User
    Join Date
    07-16-2010
    Location
    Sand Diego, CA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Divide the sum of a range by the number of non blanks

    I have a basic vertical range sum that i need to divide by the number of non blanks in that range to get an average. Currently I just count the number of non blanks in that range and change the formula manually, but it is a pain. I would be phsyced if I could have a formula or something that would determine that and do it automaticaly. The formula I'm using is pretty simple: =SUM(H3:H10)/1, the 1 being the number that changes based on how many cells above it are populated.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Need a formula to divide the sum of a range by the number of non blanks in that r

    Welcome to the forum.

    =average(h3:h10)

    Average ignores blanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    07-16-2010
    Location
    Sand Diego, CA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Need a formula to divide the sum of a range by the number of non blanks in that r

    Rad, thanks. So, in addition, sometimes the cells to be averaged will all be blank, but I don't want to remove them, however the result is the #div/0 error in the box, can I make it so that it just shows as a 0 or a blank when that is the case?

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Need a formula to divide the sum of a range by the number of non blanks in that r

    =if(count(h3:h10), average(h3:h10), "")

  5. #5
    Registered User
    Join Date
    07-16-2010
    Location
    Sand Diego, CA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Need a formula to divide the sum of a range by the number of non blanks in that r

    Sweet, that is perfect. How does that work...

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Need a formula to divide the sum of a range by the number of non blanks in that r

    See Help for the Count function and post back if you still don't get it.

+ 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