SOLVED

StDev of values in column X for all rows with identical values in column Y

%3CLINGO-SUB%20id%3D%22lingo-sub-2877646%22%20slang%3D%22en-US%22%3EStDev%20of%20values%20in%20column%20X%20for%20all%20rows%20with%20identical%20values%20in%20column%20Y%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2877646%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20figure%20out%20how%20to%20have%20my%20spreadsheet%20calculate%20the%20standard%20deviation%20of%20values%20in%20one%20column%20on%20a%20range%20where%20all%20the%20values%20in%20another%20column%20are%20identical.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20may%20be%20several%20identical%20values%20or%20none%20in%20column%20Y%2C%20and%20I%20have%20been%20working%20against%20myself%20for%20too%20long.%20I%20want%20to%20find%20the%20maximum%20variation%20in%20one%20parameter%20that%20can%20still%20result%20in%20the%20same%20answer.%20I%20have%20been%20using%20standard%20deviation%20but%20am%20open%20to%20any%20measure%20of%20variability%2C%20as%20long%20as%20the%20formula%20can%20flex%20to%20accommodate%20variable%20ranges%20based%20on%20identical%20answers%20in%20column%20Y%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20I%20get%20excel%20to%20recognize%20a%20%22family%22%20and%20then%20do%20something%20based%20on%20that%20range%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2877646%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2877675%22%20slang%3D%22en-US%22%3ERe%3A%20StDev%20of%20values%20in%20column%20X%20for%20all%20rows%20with%20identical%20values%20in%20column%20Y%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2877675%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1080757%22%20target%3D%22_blank%22%3E%40KadieB%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DSTDEV.S(IF(F1%3AF25%3DG1%3AG25%2CF1%3AF25))%3C%2FP%3E%3CP%3EIs%20this%20the%20dynamic%20formula%20you%20are%20looking%20for%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2877716%22%20slang%3D%22en-US%22%3ERe%3A%20StDev%20of%20values%20in%20column%20X%20for%20all%20rows%20with%20identical%20values%20in%20column%20Y%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2877716%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1080757%22%20target%3D%22_blank%22%3E%40KadieB%3C%2FA%3E%26nbsp%3BI%20happen%20to%20see%20and%20focus%20in%20on%20this%20part%20of%20your%20post%20%22I%20want%20to%20find%20the%20maximum%20variation%20in%20one%20parameter%20that%20can%20still%20result%20in%20the%20same%20answer.%22%20So%20I%20don't%20understand%20exactly%20what%20you%20are%20doing%20and%20a%20sample%20worksheet%20might%20help%2C%20but%20i%20wanted%20to%20mention%20that%20Excel%20has%20a%20SOLVER%20built%20in%20(DATA%20tab).%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mtarler_0-1635020826234.png%22%20style%3D%22width%3A%20203px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F319487iB98B1D9F4581AEDE%2Fimage-dimensions%2F203x206%3Fv%3Dv2%22%20width%3D%22203%22%20height%3D%22206%22%20role%3D%22button%22%20title%3D%22mtarler_0-1635020826234.png%22%20alt%3D%22mtarler_0-1635020826234.png%22%20%2F%3E%3C%2FSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22mtarler_1-1635020912651.png%22%20style%3D%22width%3A%20251px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F319488i914BB4BA6F845F4A%2Fimage-dimensions%2F251x202%3Fv%3Dv2%22%20width%3D%22251%22%20height%3D%22202%22%20role%3D%22button%22%20title%3D%22mtarler_1-1635020912651.png%22%20alt%3D%22mtarler_1-1635020912651.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ESo%20maybe%20one%20of%20these%20functions%20could%20help%20you%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2877887%22%20slang%3D%22en-US%22%3ERe%3A%20StDev%20of%20values%20in%20column%20X%20for%20all%20rows%20with%20identical%20values%20in%20column%20Y%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2877887%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1174419%22%20target%3D%22_blank%22%3E%40Quadruple_Pawn%3C%2FA%3E%26nbsp%3BI%20attached%20a%20file%20to%20better%20explain%20what%20I'm%20looking%20for.%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20need%20to%20calculate%20standard%20deviation%20(or%20any%20measure%20of%20variability%2C%20really)%20of%20variable%20sizes%20of%20data%20in%20one%20column.%20In%20the%20attached%20file%2C%20you%20can%20see%20that%20for%20every%20value%20in%20column%20A%20that%20is%20identical%2C%20I%20found%20the%20standard%20deviation%20of%20that%20same%20range%20in%20column%20B.%20I%20am%20working%20with%20thousands%20of%20rows%20of%20data%20and%207%20or%20more%20columns%20that%20I%20want%20to%20analyze%20the%20variation%20of%2C%20and%20doing%20this%20several%20times%20per%20day%2C%20so%20doing%20it%20manually%20isn't%20really%20an%20option%20for%20me.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2877918%22%20slang%3D%22en-US%22%3ERe%3A%20StDev%20of%20values%20in%20column%20X%20for%20all%20rows%20with%20identical%20values%20in%20column%20Y%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2877918%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1080757%22%20target%3D%22_blank%22%3E%40KadieB%3C%2FA%3E%26nbsp%3B%20Your%20indicated%20you%20have%20Excel365%20so%20you%20have%20FILTER%20and%20UNIQUE%20functions.%26nbsp%3B%20in%20the%20Attached%20I%20created%20a%20small%20table%20based%20on%20using%20those%20functions.%26nbsp%3B%20In%20Columns%20F%26amp%3BG%20are%20using%20regular%20references%20which%20means%20you%20need%20to%20adjust%20the%20range%20based%20on%20the%20amount%20of%20data.%26nbsp%3B%20In%20columns%20I%26amp%3BJ%20I%20use%20TABLE%20references%20so%20as%20you%20have%20more%20or%20less%20data%20in%20the%20table%20(I%20defined%20the%20data%20to%20be%20a%20table)%20the%20formulas%20will%20automatically%20scale.%26nbsp%3B%20That%20said%2C%20the%20formula%20for%20std%20dev%20in%20both%20cases%20needs%20to%20be%20pulled%20down%20to%20include%20all%20the%20unique%20values%20found%20in%20the%20previous%20column.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2877991%22%20slang%3D%22en-US%22%3ERe%3A%20StDev%20of%20values%20in%20column%20X%20for%20all%20rows%20with%20identical%20values%20in%20column%20Y%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2877991%22%20slang%3D%22en-US%22%3EThank%20you%2C%20I%20think%20I%20can%20make%20this%20work!%3C%2FLINGO-BODY%3E
New Contributor

I am trying to figure out how to have my spreadsheet calculate the standard deviation of values in one column on a range where all the values in another column are identical. 

 

There may be several identical values or none in column Y, and I have been working against myself for too long. I want to find the maximum variation in one parameter that can still result in the same answer. I have been using standard deviation but am open to any measure of variability, as long as the formula can flex to accommodate variable ranges based on identical answers in column Y

 

How can I get excel to recognize a "family" and then do something based on that range?

7 Replies

@KadieB 

=STDEV.S(IF(F1:F25=G1:G25,F1:F25))

Is this the dynamic formula you are looking for?

 

 

@KadieB I happen to see and focus in on this part of your post "I want to find the maximum variation in one parameter that can still result in the same answer." So I don't understand exactly what you are doing and a sample worksheet might help, but i wanted to mention that Excel has a SOLVER built in (DATA tab).

mtarler_0-1635020826234.png              mtarler_1-1635020912651.png

So maybe one of these functions could help you?

 

 

@Quadruple_Pawn I attached a file to better explain what I'm looking for.

I need to calculate standard deviation (or any measure of variability, really) of variable sizes of data in one column. In the attached file, you can see that for every value in column A that is identical, I found the standard deviation of that same range in column B. I am working with thousands of rows of data and 7 or more columns that I want to analyze the variation of, and doing this several times per day, so doing it manually isn't really an option for me.

best response confirmed by KadieB (New Contributor)
Solution

@KadieB  Your indicated you have Excel365 so you have FILTER and UNIQUE functions.  in the Attached I created a small table based on using those functions.  In Columns F&G are using regular references which means you need to adjust the range based on the amount of data.  In columns I&J I use TABLE references so as you have more or less data in the table (I defined the data to be a table) the formulas will automatically scale.  That said, the formula for std dev in both cases needs to be pulled down to include all the unique values found in the previous column.

Thank you, I think I can make this work!

@KadieB 

You could also use a pivot table.

A in rows area.

B in values area. Change the calculation to StDev.

 

@KadieB 

Soon it will be possible to take the @mtarler solution further using Lambda helper functions.

= LET(
    STDDEVλ, LAMBDA(a,
      LET(
        sublist, FILTER(tbl[B], tbl[A]=a),
        IF(COUNT(sublist)>1, STDEV.S(sublist),0))),
   distinct, SORT(UNIQUE(tbl[A])),
   CHOOSE({1,2}, distinct, MAP(distinct, STDDEVλ)))

The first LET allows the local names 'STDDEVλ' and 'distinct' to be defined for use in the final line.  STDDEVλ takes a single value from tbl[A] and calculates the standard deviation from the corresponding sub-list.  The name 'distinct' is applied to the sorted list of values from column [A].  After the setup the final line, the MAP function feeds the distinct values into STDDEVλ one at a time.  CHOOSE is simply a device to combine the two columns so that they may be output from a single formula.

image.png