STDEV with multiple criteria with blank cells

bluesky6688

New Member
Joined
Dec 24, 2013
Messages
34
Hello all,

I have trouble with calculating standard error with multiple criteria. Below is the formula I used:

=STDEV(IF($J$2:$J$25="A",IF($K$2:$K$25="B",IF($L$2:$L$25=1,M2:M25))))/SQRT(COUNTIFS($J$2:$J$25,"A",$K$2:$K$25,"B",$L$2:$L$25,1,M2:M25,"<>"))

The problem is the blank cells in the range that I am calculating (M2:M25). Everything is alright if there were no blank cells in M2:M25. If there were any blank cells, however, the STDEV was wrong (the countifs part was correct). It treated the blank cells as zero.

Thanks for your help and wish you a Merry Christmas!
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Add a criteria to test for blanks in M2:M25

=STDEV(IF(($J$2:$J$25="A")*($K$2:$K$25="B")*($L$2:$L$25=1)*($M$2:$M$25<>""),M2:M25,""))
/SQRT(
COUNTIFS($J$2:$J$25,"A",$K$2:$K$25,"B",$L$2:$L$25,1,M2:M25,"<>"))
 
Upvote 0
Why not prefer...

Control+shift+enter, not just enter:

=STDEV(IF($J$2:$J$25="A",IF($K$2:$K$25="B",IF($L$2:$L$25=1,IF(ISNUMBER(M2:M25),M2:M25)))))/
SQRT(SUM(IF($J$2:$J$25="A",IF($K$2:$K$25="B",IF($L$2:$L$25=1,IF(ISNUMBER(M2:M25),M2:M25))))))

as the calc involves only numbers?
 
Upvote 0
Add a criteria to test for blanks in M2:M25

=STDEV(IF(($J$2:$J$25="A")*($K$2:$K$25="B")*($L$2:$L$25=1)*($M$2:$M$25<>""),M2:M25,""))
/SQRT(
COUNTIFS($J$2:$J$25,"A",$K$2:$K$25,"B",$L$2:$L$25,1,M2:M25,"<>"))

This works exactly as I wanted. Thanks!
 
Upvote 0
Why not prefer...

Control+shift+enter, not just enter:

=STDEV(IF($J$2:$J$25="A",IF($K$2:$K$25="B",IF($L$2:$L$25=1,IF(ISNUMBER(M2:M25),M2:M25)))))/
SQRT(SUM(IF($J$2:$J$25="A",IF($K$2:$K$25="B",IF($L$2:$L$25=1,IF(ISNUMBER(M2:M25),M2:M25))))))

as the calc involves only numbers?

This works if I change "SUM" to "COUNT". Thanks!
 
Upvote 0
This works if I change "SUM" to "COUNT". Thanks!

That's Ok, although I meant to jot down:

=STDEV(IF($J$2:$J$25="A",IF($K$2:$K$25="B",IF($L$2:$L$25=1,IF(ISNUMBER(M2:M25),M2:M25)))))/
SQRT(SUM(IF($J$2:$J$25="A",IF($K$2:$K$25="B",IF($L$2:$L$25=1,IF(ISNUMBER(M2:M25),1))))))
 
Upvote 0
That's Ok, although I meant to jot down:

=STDEV(IF($J$2:$J$25="A",IF($K$2:$K$25="B",IF($L$2:$L$25=1,IF(ISNUMBER(M2:M25),M2:M25)))))/
SQRT(SUM(IF($J$2:$J$25="A",IF($K$2:$K$25="B",IF($L$2:$L$25=1,IF(ISNUMBER(M2:M25),1))))))

I see... There are so many ways to do it. Thanks again!
 
Upvote 0

Forum statistics

Threads
1,215,511
Messages
6,125,250
Members
449,218
Latest member
daynle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top