Conditional Standard Deviation in Ms. Excel - excel

So I want to count a standard deviation. I have two columns. The range of the first column is A2:A201. And this column have several labels, one of it is "Good" label. And the range of the second column is E2:E201, this column contains numerous values.
So how to count the standard deviation of the second column when the condition of the first column is "Good"?
And I thought this would work but it's not.
=STDEV.P(IF($A$2:$A$201="Good",$E$2:$E$201))

I suggest you calculating it with standard formula (Ctrl+shift+enter):
={SQRT(SUMSQ(B1:B4*(A1:A4="x"))/COUNTIFS(A1:A4;"x")-AVERAGEIFS(B1:B4;A1:A4;"x")^2)}
Another way is to add column with additional calculations.
Similar things work with sumproduct function for example (more information here: https://www.ablebits.com/office-addins-blog/2016/08/24/excel-sumproduct-function-formula-examples/)
Update: checked your formula in comment {=STDEV.P(IF(A1:A4="x";B1:B4))}, surprisingly it works))

Related

Returning sum of column for filtered data, without filter

I'm trying to calculate the sum of a column (TSQFT in the screenshot) that is part of a data set, which would be filtered based on multiple criteria using cell references (see screenshot). I don't want to use excel's regular filter as it's a hassle to change the settings and I'd like it to be done in a more automated way.
I've tried {SUMIF} and {SUMIFS} but those do not work as a filter - i.e. for a row to be {TRUE}, the numbers have to be in the same order as that specified in the criteria list {5-7-2} (see screenshot).
Would much appreciate any help.
You can try something like this:
Make 3 column of =IF(OR(C3=$C$10;C3=$D$10;C3=$E$10);1;0) formulas, one more column for a sum of this 3 column and a sumif based of the sum values
if the sum is 3 then the value is good.
This maybe the worst solution for this but as long as it can help, it can be developed into something better.

SUMIF formula based on non-contiguous ranges

I have to populate a cash-flow forecast, dependent on dates between the programme and a spend profile matching. Usually I would do this with SUMIF, using two rows for each element of the cost estimate (stacking the '1st' date of the month above the cost). However, I need to perform all of the calculations for this project in the same row. Is it possible?
I have tried to liberate solutions to similar queries (using SUMPRODUCT, OFFSET, INDEX etc), but I am never able to get the correct result. This may be due my lack of ability to doctor them, rather than these functions failing to provide the solution I need.
Ideally, I would like to formulate the following. "IF the date in every 5th column in the Spend Profile range matches the date in row 2 of the Programme range, SUM the value(s) in the cell(s) 2 columns prior".
The image below shows a very scaled down version of the data I have to work with. I have manually entered the expected results in the Programme range to illustrate the desired result. nb. CELLS G4 and L4 match S2, therefore E4 and J4 are returned.
Sample Data: Scaled down
You can make it work with SUMIFS with your sample data by offsetting the ranges like this
=SUMIFS($A4:$O4,$C2:$Q2,"1st",$C4:$Q4,S$2)

comparing cells to a any cells in a given column

I have the following columns in Excel.
What I'm trying to do is to get data from two sets of column transferred to another set of column if their first column cell matches. So in the screenshot since boy has 100 in column I. it should transfer the 100 to Column C where Boy Row is.
I figured out a away to do it in Java using loops but I thought there might be an easier way of doing it directly in excel.
Although Vlookup is a formula that will work for your needs, it does come with some limitations. Better start using the best way from the start, which is nesting a Match formula in an Index one. With the example provided above:
=Index(I:I,Match(B:B,H:H,0))

Sorting formulas issue

I have a table which consists of names (1st column) avarageifs (2-6 columns) and average formulas (7 column).
Averageifs formula is taking the name to average values for each name:
=IFERROR(AVERAGEIFS(Grades!B:B,Grades!$A:$A,Rankings!$B14),"N/A")
"Total" average formula is:
=IFERROR(AVERAGE(C14:G14),0)
Then I am trying to sort it by "total" average, formulas are mixing up and referring to different rows.
But it should refer to the same row. What happens after sorting and how can I fix it?
Basically the references in the AVERAGEIFS formulae are getting swapped around and you don't want this to happen.
The easiest way round it would be to put the Totals column next to the Names column and just sort these two columns, leaving the other formulae in place.
If you don't want to do that, a fairly quick and dirty solution is to replace the AVERAGEIFS formulae with this so they always refer to the current row:-
=IFERROR(AVERAGEIFS(Grades!B:B,Grades!A:A,INDIRECT("Rankings!$B"&ROW())),"N/A")
See the discussion here

Using an excel formula on filtered cells?

I have the following excel spreadsheet:
The elevation is increasing in ascending order. The distance is culmulative. Criteria is a separate formula which can be explained here:
Selecting values in a list based on an interval?
I want to calculate the slope which is the difference in elevation divided by the difference in distance, but only for the values that have a criteria of "1". Here is a picture showing the spreadsheet filtered and cut where I get the expected values of slope:
I want to perform this formula on the unfiltered list and to get the desired result in the third image.
Are there any formula operations in excel that can perform this task? Can it be done in VBA?
You can add 2 helper columns to your table like so:
Col D tracks the last Elevation that met your criteria. Similarly, Col E selects the last Distance that met your criteria. This keep COL F's formula super simple.
Note this is a variation on Alan's comment, but I prefer the legibility and maintainability of the additional columns to the expert level (and lengthy) formula.

Resources