Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Problem with Average (I think)

  1. #1
    New Member
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    42
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I want to find the Average of cells F45 to Y45. But the last 5 cells (U45:Y45) do not have values in them yet. What do I need in the formula to ignore any cells that do not have a value, until they have a value. (number) in them?

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi
    As far as I know, the Average function ignores blanks...
    Tom

  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Newcastle, UK
    Posts
    1,174
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-23 02:07, Phylis Sophical wrote:
    I want to find the Average of cells F45 to Y45. But the last 5 cells (U45:Y45) do not have values in them yet. What do I need in the formula to ignore any cells that do not have a value, until they have a value. (number) in them?
    You don't need anything other than AVERAGE() if it's JUST blanks or formula generated blanks.

    I personally prefer to omit any error in this area by using something like

    =SUM(F45:Y45)/COUNTIF(F45:Y45,">"&0).

    then I have a clear understanding of the formula rather than just exepting something working because that's what its ment to do.
    "Have a good time......all the time"
    Ian Mac

  4. #4
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    84,034
    Post Thanks / Like
    Mentioned
    37 Post(s)
    Tagged
    7 Thread(s)

    Default

    On 2002-04-23 02:34, Ian Mac wrote:
    On 2002-04-23 02:07, Phylis Sophical wrote:
    I want to find the Average of cells F45 to Y45. But the last 5 cells (U45:Y45) do not have values in them yet. What do I need in the formula to ignore any cells that do not have a value, until they have a value. (number) in them?
    You don't need anything other than AVERAGE() if it's JUST blanks or formula generated blanks.

    I personally prefer to omit any error in this area by using something like

    =SUM(F45:Y45)/COUNTIF(F45:Y45,">"&0).

    then I have a clear understanding of the formula rather than just exepting something working because that's what its ment to do.
    Ian,

    That formula excludes true zeroes and negative numbers!

    Aladin

  5. #5
    New Member
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    42
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Yes that was the problem Ian. Those are formula generated blanks. (I guess)In this case, I don't have to worry about negative numbers nor should it ever be zero. There is either a number above zero, or nothing because the formula in that cell says not to put anything in there if no number has been put in the cell that connects to the formula. Sorry I don't know the exact terminology but I'm sure you can all use a good chuckle today.

    Can I ask what the & sign does?

  6. #6
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    84,034
    Post Thanks / Like
    Mentioned
    37 Post(s)
    Tagged
    7 Thread(s)

    Default

    On 2002-04-23 03:30, Phylis Sophical wrote:
    Yes that was the problem Ian. Those are formula generated blanks. (I guess)In this case, I don't have to worry about negative numbers nor should it ever be zero. There is either a number above zero, or nothing because the formula in that cell says not to put anything in there if no number has been put in the cell that connects to the formula. Sorry I don't know the exact terminology but I'm sure you can all use a good chuckle today.

    Can I ask what the & sign does?
    AVERAGE ignores formula-generated blanks.

    Start a clean worksheet.

    In A1 enter: =IF(B1,1,"")

    In A2 enter: 4

    In A3 enter: 3

    In A4 enter:

    =AVERAGE(A1:A3)

    =AVERAGE(A1,A2:A3)

    What do you get?

    BTW, & is a concatenation operator; In the formula Ian suggested, it creates ">0" when evaluated. & is needed to build up the condition argument in COUNTIF and SUMIF using cell references.

    Aladin

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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