Results 1 to 4 of 4

StDev formula using array returns incorrect results

Threaded View

Elgin26 StDev formula using array... 05-29-2018, 08:14 AM
modytrane Re: StDev formula using array... 05-29-2018, 09:31 AM
Elgin26 Re: StDev formula using array... 05-29-2018, 10:56 AM
FlameRetired Re: StDev formula using array... 05-29-2018, 11:01 AM
  1. #1
    Registered User
    Join Date
    05-29-2018
    Location
    Southampton, England
    MS-Off Ver
    2007
    Posts
    5

    StDev formula using array returns incorrect results

    Hi, this is my first post on the forum. I have tried to simplify my problem with the attached picture.

    In the first worksheet [Data] I have the collected raw data. In the second worksheet [Results], I need to calculate both the average and standard deviation of this data.

    ExcelForum1.png

    I need to calculate the StDev of the lat/long/vert data for each individual ID [col A] and have inserted an "ID by row" [Data, col B] to avoid a merged cell crisis with the formula.

    This formula [in theory] looks to find the StDev of the values whose ID in Results [col A] matches with the "ID by row" [col B] on the Data sheet - the idea being the StDev will be calculated based on every value in the rows with the same identifier:


    L3 - Lat: {=IFERROR(STDEV(IF(Data!$B$2:$B$26=Results!$A3,Data!$E$2:$E$26,"")),"")}
    M3 - Long: {=IFERROR(STDEV(IF(Data!$B$2:$B$26=Results!$A3,Data!$F$2:$F$26,"")),"")}
    N3 - Vert: {=IFERROR(STDEV(IF(Data!$B$2:$B$26=Results!$A3,Data!$G$2:$G$26,"")),"")}


    This works for the first row only [ID 1], however when I copy the formula down [=Results!$A4 and on...] the answers generated are incorrect and do not match. [Eg: ID 3 only has one value in the lat/long/vert, so the StDev of one value should return a #Div/0!, or blank after I use the IFERROR, but =Results!$A5 returns 0.107 for lat and 0.027 for long]. If the array doesn't copy down, the values returned are the StDev for all values in the respective data column, which is not what I am after.

    I can achieve the correct answers by manually selecting every range [Results H3: =IFERROR(STDEV(Data!E2:E6),"") and H4: =IFERROR(STDEV(Data!E7:E11),"") and so on] but I don't want to have to do this hundreds of times for each individual ID as it is a very large data set and continues to grow on a daily basis.


    Can anyone help me find out where I've gone wrong, or if what I'm trying to achieve is even possible? I suspect it's to do with the ID's not correctly being matched in the IF formula but I can't find another way of doing this online that gets me remotely close to these answers.
    I am using Excel 2007.

    Thanks in advance for any assistance.
    Last edited by Elgin26; 05-29-2018 at 08:17 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Index Small If array formula with mulitple criteria returning incorrect results
    By EmmatheDancer in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-08-2015, 12:52 PM
  2. Days360 Returns Incorrect Results Sometimes
    By goss in forum Excel General
    Replies: 2
    Last Post: 03-19-2014, 12:57 AM
  3. [SOLVED] Complex if statement returns incorrect results
    By amk73 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 01-20-2014, 09:18 AM
  4. Dragged formula returns incorrect results
    By ybortony in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-19-2014, 02:27 PM
  5. Query searching returns incorrect results
    By vampyr07au in forum Access Tables & Databases
    Replies: 18
    Last Post: 06-02-2011, 11:35 AM
  6. Query in Access returns incorrect results
    By johnhurgeton in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-17-2010, 11:31 AM
  7. Replies: 1
    Last Post: 03-09-2006, 04:00 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