+ Reply to Thread
Results 1 to 9 of 9

Average help

  1. #1
    Registered User
    Join Date
    06-15-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Average help

    Hi I am currently trying to calculate an average for a set of data but unfortunately not all data cells contain numbers and some contain #N/A .I basically want excel to ignore these values and calculate the average for the cells which do contain data.

    for example id like it to calculate as follows

    number of cards

    7
    7
    7
    7
    N/A
    average=7


    I have played around with averageif function and tried following formula but this did not work as i just obtain DIV/O ERROR

    =AVERAGEIF(AO16:AO68,"<>*(#N/A)",A16:A68)

    any help will be very useful

    kind regards

    Matt

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Average help

    Hello,

    One way to deal with this is to tackle the cells that contain the #N/A error. Why do they contain this error? What is the formula in those cells?

    Change the formula in those cells to result in "" instead of #N/A and the Average will calculate correctly.

    If that does not help, please attach a sample file that illustrates your problem.

    cheers,

  3. #3
    Registered User
    Join Date
    06-15-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Average help

    they dont contain an error I

  4. #4
    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,444

    Re: Average help

    Hi,

    You can do this using an array, eg.,

    =AVERAGE(IF(ISNUMBER(A1:A3),A1:A3,""))

    entered with CTRL, SHIFT and ENTER.
    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".

  5. #5
    Registered User
    Join Date
    06-15-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Average help

    ok attached is a sample column I inserted the n/a myself as didn't have data for these fields.

    regards matt
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: Average help

    So long as your values are always positive, you could use:

    =SUMIF(B2:B63,">0",B2:B63)/COUNTIF(B2:B63,">0")

  7. #7
    Registered User
    Join Date
    06-15-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Average help

    thanks all for quick and helpful responses

    how would this formula vary to calculate the standard deviation?

    regards matt
    Last edited by catdawg88; 06-15-2011 at 07:23 AM.

  8. #8
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Average help

    In your initial post you say

    some contain #N/A
    That's an error.

    Then you say
    they dont contain an error
    That does not gel. Please make up your mind.

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Average help

    Hello Matt,

    Yes, #N/A is still an error value, even if entered manually into cells. If you entered a text value like N/A (without the #) then that would be treated differently. AVERAGE ignores text so you could use a straightforward AVERAGE function, i.e.

    =AVERAGE(B2:B63)

    but with the data as shown you could use AVERAGEIF as you initially suggested, i.e.

    =AVERAGEIF(B2:B63,"<>#N/A")

    For STDEV try this array formula

    =STDEV(IF(ISNUMBER(B2:B63),B2:B63))

    confirmed with CTRL+SHIFT+ENTER
    Audere est facere

+ 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