+ Reply to Thread
Results 1 to 8 of 8

AVERAGEIF and STDEV ignoring errors

  1. #1
    Registered User
    Join Date
    02-19-2015
    Location
    Boston, MA
    MS-Off Ver
    2007
    Posts
    6

    AVERAGEIF and STDEV ignoring errors

    Hi everyone,

    So I have a large dataset in which I need to calculate the average and standard deviation of a particular column (X:X) with the condition that another column meets a certain criteria (V:V, "=1").

    I tried to use =AVERAGEIF(X:X,"=1",V:V) and {=STDEV(IF(V:V=1),X:X))}, but am getting #N/A in return.

    I think the issue may be that the X:X column contains few cells with errors (#N/A) within the range.

    So in summary: is there a way to calculate the average and standard deviation for X:X with the condition that V:V meets the criteria of holding numerical value 1, while ignoring the cells in X:X with error values?

    Thank you so much for your help in advance!

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,331

    Re: AVERAGEIF and STDEV ignoring errors

    Array enter - enter using Ctrl-Shift-Enter

    =AVERAGE(IF(NOT(ISERROR(V:V)),IF(V:V=1,X:X)))

    Likewise for Stdev:

    =STDEV(IF(NOT(ISERROR(X:X)),IF(X:X=1,V:V)))
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    02-19-2015
    Location
    Boston, MA
    MS-Off Ver
    2007
    Posts
    6

    Re: AVERAGEIF and STDEV ignoring errors

    Hm, I tried that, and still got #N/A again for the average and #DIV/0 for the standard deviation.

    FYI:
    For another criterion (V:V>1), the original averageif and stdev (CSE for stdev)formulas I tried seem to work fine. For example, =AVERAGEIF(V:V,">1",X:X)gives a value, as well as {=STDEV(IF(V:V>1),X:X))}. I noticed that for these rows where column V is greater than 1, there happen to be no #N/A errors in the column X. In other words, the only times the X:X column has #N/A error happened to be when V:V=1. This is why I assumed that it was the #N/A errors in the X column that was causing the trouble.


    Thank you so much for your help!

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,331

    Re: AVERAGEIF and STDEV ignoring errors

    Post a workbook here, with a small sample of data that shows the error.

  5. #5
    Registered User
    Join Date
    02-19-2015
    Location
    Boston, MA
    MS-Off Ver
    2007
    Posts
    6

    Re: AVERAGEIF and STDEV ignoring errors

    I've attached a sample here.
    Basically, I would like to calculate the average Score and its standard deviation with the condition that there is a "1" in the first column. Thanks again!
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,331

    Re: AVERAGEIF and STDEV ignoring errors

    I interpreted your description of where the errors were incorrectly, so array enter for the example file (enter using Ctrl-Shift-Enter

    =AVERAGE(IF(NOT(ISERROR(B:B)),IF(A:A=1,B:B)))

    =STDEV(IF(NOT(ISERROR(B:B)),IF(A:A=1,B:B)))

    For the original statement:

    =AVERAGE(IF(NOT(ISERROR(X:X)),IF(V:V=1,X:X)))
    =STDEV(IF(NOT(ISERROR(X:X)),IF(V:V=1,X:X)))

  7. #7
    Registered User
    Join Date
    02-19-2015
    Location
    Boston, MA
    MS-Off Ver
    2007
    Posts
    6

    Re: AVERAGEIF and STDEV ignoring errors

    Ahhhhh it worked perfectly for the sample dataset (thank you! I was so excited for a moment), but for some reason, error still shows up in the original document (which is only different in that it has 1300+ rows).

  8. #8
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,331

    Re: AVERAGEIF and STDEV ignoring errors

    Did you enter the formula using Ctrl-Shift-Enter? You can post an attachment up to 1 MB, so sanitize your workbook and post it...

+ 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. [SOLVED] Averageif ignoring #N/A
    By fgruhlke in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-07-2014, 10:26 PM
  2. [SOLVED] AVERAGEIF - Ignoring 0 values - It's supposed to but not doing it.
    By BeachRock in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-25-2013, 11:57 PM
  3. using stdev similar to the averageif function
    By DisplacedMic in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-22-2012, 08:52 AM
  4. Ignoring Zeros in a STDEV Forumula
    By OlYeller21 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2011, 09:39 AM
  5. ignoring #N/A in column average, stdev, etc
    By usererrr in forum Excel General
    Replies: 2
    Last Post: 10-19-2010, 06:08 PM

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