How to obtain minimum into the range when values >0? - excel-formula

I'm using this MINIFS formula on google sheet without problem
=MINIFS(D$2:D$1000;B$2:B$1000;J11)
but I need to obtain the minimum value into the range d$2:d$1000 excluding values <=0
so I tried different formulas like this
=MIN(IF(B$2:B$1000=J11,IF(D$2:D$1000>0,D$2:D$1000)))
that give me error :(

Just add a criteria to the MINIFS:
=MINIFS(D$2:D$1000;B$2:B$1000;J11;D$2:D$1000;">0")

Related

Is there a way to perform an XLOOKUP on a range of values using VBA in a way that if a new row is added in the middle of the range, the XLOOKUP works?

I am attemping to use a range of values to find another set of related values using the formula:
=XLOOKUP(K25:K32, B:B, C:C)
I have considered having the formulas be calculated entirely within VBA however, the resulting program requires that users are able to remove and add rows as necessary, with the dynamic formula on Column R starting at R25 providing the necessary information.
Entering this through excel works as expected, getting the values for every value from K25 to K32 and their respective counterparts from C:C.
Attempting to enter this formula using VBA, namely:
Range("R25").Formula = "=XLOOKUP(K25:K32, B:B, C:C)"
Results in
=XLOOKUP(#K25:K32, B:B, C:C)
Which only works on the first value in K25.
Is there something I am missing here? Thank you!

Find the average but without using range

Just want to ask if there is an easy way for me to find the average but not using range since the values are placed in different cells?
Here the cells and the formula that I'm using to get the average (J28+O28+T28+Y28+AD28+AI28+AN28+AS28+AX28)/9
It is working, yes. But the problem is that there is a cell that the value may be empty. For example, all of it has a value except for AS28 & AX28, so the denominator should be 6 and not 9.
Is there a way for me to easily do this? Thanks!
Just use
=AVERAGE(J28,O28,T28,Y28,AD28,AI28,AN28,AS28,AX28)
It will happily ignore empty and non-numeric cells
Note: your cells list included 9 cells, so that sould be /9 right?
Use COUNTA() function to exclude empty cells. Try below formula-
=(J28+O28+T28+Y28+AD28+AI28+AN28+AS28+AX28)/COUNTA(J28,O28,T28,Y28,AD28,AI28,AN28,AS28,AX28)

Is there a way to calculate standard deviation on a range of cells only for cells where the value is greater than 0 in Excel?

I have a range of cells, say A1 to A100. I want to calculate the standard deviation for that range of cells but only take into account cells where the value is greater than 0. Is there a way to do this in excel? I tried =stdev(if(A1:A100>0,A1:A100,0)) but it does not seem to be giving me the right results.
Very similar to Scott's comment, I would use STDEV.P:
=STDEV.P(IF(A1:A100>0,A1:A100)) and confirm with Ctrl+Shift+Enter
If your version of Excel supports FILTER(), try:
=STDEV(FILTER(A1:A100,A1:A100>0))
Your problem is that you are setting all the zero values back to zero
=stdev(if(A1:A100>0,A1:A100**,0**))
Instead, use this:
=stdev(if(A1:A100>0,A1:A100))

SUMIF with several OR criteria

The blue cell summates to 1, but that is not correct and it should summate to more because of the row text match with B47 row. Any ideas what's wrong?
SUMIF is not supposed to work with more than one criteria (you can't check multiple criteria within one SUMIF as you tried in your formula).
This formula will calculate the right result for you: =SUM(B3:BI3*(IFERROR(MATCH(B2:BI3,B47:AL47,0)>0,0))), this is an array formula, so you need to press CTRL+SHIFT+ENTER after it.
MATCH(...): look for all students whether they are in the list with requirments (this is the part which works only as array formula)
IFERROR(...): converts #N/A errors to 0
If I am not wrong, you are trying to calculate the number of students for a particular project with skill1 and skill2.
You may also try using COUNTIFS() function. This works for multiple criteria.

excel formula using array of non adjacent cells

I have a table with 2 columns, where
A contains objects, and
B their costs
I am trying to display the object that corresponds to the minimum cost of a range of non-adjacent cells. I wrote this formula:
=INDIRECT(CELL("address",INDEX(CHOOSE({1,2,3,4,5,6,7},A3,A9,A12,A13,A18,A21,A22),MATCH(MIN(B3,B9,B12,B13,B18,B21,B22),CHOOSE({1,2,3,4,5,6,7},B3,B9,B12,B13,B18,B21,B22),0))))
I get #VALUE!, what's the error in my approach?
Try just the INDEX/MATCH part
=INDEX(CHOOSE({1,2,3,4,5,6,7},A3,A9,A12,A13,A18,A21,A22),MATCH(MIN(B3,B9,B12,B13,B18,B21,B22),CHOOSE({1,2,3,4,5,6,7},B3,B9,B12,B13,B18,B21,B22),0))
I am assuming that you just want to get the name of the object whose value is the minimum among the cells you detailed.
=INDEX(A:B,MATCH(MIN(B3,B9,B12,B13,B18,B21,B22),B:B),1)
Screenshot:
Let us know if this helps.

Resources