+ Reply to Thread
Results 1 to 5 of 5

#DIV/0! issue - cant get rid of it within another formula

  1. #1
    Registered User
    Join Date
    10-12-2007
    Location
    Victoria, Australia
    Posts
    3

    #DIV/0! issue - cant get rid of it within another formula

    Hello all
    This looks like a forum I will frequent from now on :P

    Im trying to get rid of the #DIV/0! error. I want a '0' instead so as the rest of my calculations will work. However this needs to be achieved whilst also having an =average function.

    ie: I need an average of the figures in a1:a7 to appear in a8, but if theres no data in a1:a7 then I need a8 to read '0'

    I cannot populate the empty cells in a1:a7 with a '0' either - I wish I could, but for this project I cant.

    I hope this makes sense - im doing my head in over this.

    Thanks heaps in advance!

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    Hi,

    Try this in A8

    =IF(ISERROR(AVERAGE(A1:A7)),"0",AVERAGE(A1:A7))
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    10-12-2007
    Location
    Victoria, Australia
    Posts
    3
    I was soooo close - just had a few things muddled up - thanks so much for helping - its perfect! **grovels prefusly*
    If it aint broke - fix it till it is........

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699
    Here's a couple of methods you could employ.....

    =SUM(A1:A7)/MAX(1,COUNT(A1:A7))

    or

    =IF(COUNT(A1:A7),AVERAGE(A1:A7),0)

  5. #5
    Registered User
    Join Date
    10-12-2007
    Location
    Victoria, Australia
    Posts
    3
    how on earth do you guys get so good at this - its amazing! Thanks again!

+ 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