+ Reply to Thread
Results 1 to 3 of 3

Standard deviation using IF and OR function for multiple conditions

  1. #1
    Registered User
    Join Date
    11-23-2020
    Location
    Copenhagen
    MS-Off Ver
    Office16
    Posts
    6

    Standard deviation using IF and OR function for multiple conditions

    Dear ex(cel)perts,

    I have run into a problem analyzing some data from a questionnaire.

    I would like to calculate the standard deviation for one variable - their weight, but they have to meet either of two conditions.
    Or said in another way: In the questionnaire they have 3 options, but I only want to calculate the standard deviation of their weight if they have chosen option 1 or option 2, not option 3.

    I have tried using the following formulas, but they did not work (even with ctrl+alt+enter):
    =STDEV.P(IF(OR(Question Datarange="Option1",Question Datarange="Option2"),Weight Datarange))
    =STDEV.P(IF(Question Datarange="Option1",Weight Datarange),IF(Question Datarange="Option2",Weight Datarange))

    Anyone who can help me out here?

    Best Regards
    Knut

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Standard deviation using IF and OR function for multiple conditions

    =STDEV.P(IF(A2:A10="option1",C2:C10,IF(A2:A10="option2",C2:C10,""))) as an array. Hopefully you can change the ranges for your data. a2:a10=question data range

    I think =STDEV.P(IF(A2:A10="option1",C2:C10,IF(A2:A10="option2",C2:C10))) will also work, but prefer to get rid of the FALSE values in the array

    a2:a10 = question daterange
    c2:c10 = weight daterange


    or =STDEV.P(IF(A2:A10<>A10,"option 3" C2:C10,""))


    All entered as an array
    Last edited by davsth; 11-23-2020 at 07:11 AM.

  3. #3
    Registered User
    Join Date
    11-23-2020
    Location
    Copenhagen
    MS-Off Ver
    Office16
    Posts
    6

    Re: Standard deviation using IF and OR function for multiple conditions

    Wow, quick response and it worked! Thank you very much.

    I am very grateful!

+ 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. Standard Deviation with multiple conditions
    By ARROW5073 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-30-2020, 01:58 PM
  2. [SOLVED] Calculate standard deviation based on conditions.
    By Max_excel in forum Excel General
    Replies: 7
    Last Post: 07-05-2019, 02:39 PM
  3. Moving/trailing standard deviation (multiple conditions?)
    By Stikker in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-15-2015, 08:38 AM
  4. Mean and Standard Deviation Function (in % form), please help
    By ssq in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-02-2013, 05:31 AM
  5. Standard deviation and if function?
    By zhuowang1980 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-30-2013, 02:37 PM
  6. Standard deviation custom function
    By Arvex in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-14-2011, 02:21 AM
  7. VBA Function to calculate Mean and Standard Deviation
    By Divius in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-31-2007, 07:04 AM

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