+ Reply to Thread
Results 1 to 8 of 8

Covariance function to ignore #n/a pairs

  1. #1
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Covariance function to ignore #n/a pairs

    Hey guys,

    I'm attempting to use the =COVARIANCE.S function in excel, but I'm getting a #n/a because there are n/as in A:A and B:B but in different places, so in other words each array has a different number of data points.

    Can anyone think of a formula that will modify the covariance function so that an #n/a in A:A will ignore both A:A and B:B for that data point? I.e. excel will ignore any row that has n/a in either A or B, and therefore make the number of data points the same.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Covariance function to ignore #n/a pairs

    It would be considerably easier to prevent the #N/A than to circumnavigate the restrictions on CONVAR.

    What formula is generating the error?

  3. #3
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Covariance function to ignore #n/a pairs

    Hi

    This is the formula that generate the #N/A:
    =IF(ISNA(IF(ISNUMBER($A3),VLOOKUP($A3,TRYRR,2,FALSE))),#N/A,VLOOKUP($A3,TRYRR,2,FALSE))

    The only other option is to have a blank instead of an #n/a, but that doesn't fix the fact that the two arrays have different data points.

  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: Covariance function to ignore #n/a pairs

    Have you tried replacing the NA()'s with blanks?
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Covariance function to ignore #n/a pairs

    Should have before I posted! The formula produced a number, but I'm not sure it's correct--do you know if it's doing what I want, i.e. ignoring both A and B with a blank is found in either one?

  6. #6
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Covariance function to ignore #n/a pairs

    when** a blank is found in either one

  7. #7
    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: Covariance function to ignore #n/a pairs

    I know the answer, but you should convince yourself with a test.

    Create some static random data, calculate COVAR, insert some blanks and try again.

  8. #8
    Forum Contributor
    Join Date
    07-15-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010
    Posts
    129

    Re: Covariance function to ignore #n/a pairs

    Yes, it works

+ 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. Random pairs that ignore absent students
    By nhush in forum Excel General
    Replies: 2
    Last Post: 10-10-2012, 01:24 AM
  2. Applying INDIRECT function for Covariance calculus
    By geri_n in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-13-2011, 08:58 AM
  3. COVARIANCE.S to build a covariance matrix
    By steve.lorimer in forum Excel General
    Replies: 6
    Last Post: 06-05-2011, 09:37 AM
  4. Replies: 10
    Last Post: 01-05-2011, 03:26 AM
  5. Trailing covariance with INDIRECT function
    By MCCCLXXXV in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-04-2008, 02:25 PM

Tags for this Thread

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