# Microsoft Office Application Help - Excel Help forum > Excel Formulas & Functions >  > [SOLVED] STDEV IF function with multiple criteria

## thaphthia

Hi everyone,

I'm wondering if someone can help me with one of my formulas.

I am looking to calculate the standard deviation for the values in column K2:K42, only if the values in column G2:G42 say "thin" AND if the values in column L2:L42 say "TRUE".

I tried the below formula:

=STDEV(IF($G$2:$G$42="thin",IF($L$2:$L$42="TRUE",$K$2:$K$42)))
I followed this with Shift+Cntrl+Enter, and I keep coming up with #DIV/0! error.

If anyone can help with this, that would be great! I've been working on this formula for a while now to no avail.

Lauren

----------


## rylo

Hi

Try

=STDEV(IF((G2:G42="thin")*(L2:L42),K2:K42,""))

Array entered...

rylo

----------


## Tony Valko

If the TRUE in column L is the Boolean TRUE just remove the quotes:

=STDEV(IF($G$2:$G$42="thin",IF($L$2:$L$42=TRUE,$K$2:$K$42)))

Still array entered.

----------


## thaphthia

Thank you both! Both of these formulas worked and produced the same result  :Smilie:

----------


## Tony Valko

You're welcome. Thanks for the feedback!  :Cool:

----------


## pepikkk

thanks it worked ! 

I've used as test 





03/17/2014	10	Next Day
03/18/2014	2	Other
03/19/2014	3.5	Same Day
03/17/2014	2	Same Day
03/17/2014	5	Next Day
03/17/2014	9	Next Day
03/17/2014	5	Other

E4 = 03/17/2014

=STDEV(IF($B$3:$B$43=E4,IF(OR($D$3:$D$43="Next Day",$D$3:$D$43="Same Day",$D$3:$D$43="Other"),$C$3:$C$43))) =3.271085447


To check if worked.

10
2
5
9
5
=STDEV(E10:E14) = 3.271085447

----------


## dineshpatra06

Hi

This really helped me a lot to address my desired result. But now, I am stuck with blank rows in the table. In case of blank rows, this formula assumes it as 
January month and giving erroneous Std. Deviation for January month.

Kindly help.

Refer to attachment.

----------


## FDibbins

> Hi
> 
> This really helped me a lot to address my desired result. But now, I am stuck with blank rows in the table. In case of blank rows, this formula assumes it as 
> January month and giving erroneous Std. Deviation for January month.
> 
> Kindly help.
> 
> Refer to attachment.



*Administrative Note:*

Welcome to the forum.  :Smilie: 

We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

Please see Forum Rule #4 about hijacking and start a new thread for your query.

If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

----------

