Note that the test for column B differs: "N" v. "Male". Does that explain the "wildly different result"?
No there are three choices, male, female, or just N for a non report.
Also, note that the std dev is based on only rows 2:5220, whereas the average is based on the entire column. It is better not to reference entire columns (B:B). But is there more data in the columns that you are including in your "hand" calculation, but excluding in the STDEV formula?
There is not more data, I tried both methods originally with the stdev and it worked more often with me calling out my data directly.
Are any of J2:J5220 empty? If so, any that meet all of the criteria are treated as zero in the STDEV formula, but they are ignored in the AVERAGEIF formula. If that is a possibility, you might try the following modification:
=STDEV(IF(('All Subject Data'!$C$2:$C$5220=6)*('All Subject Data'!$D$2:$D$5220=4.3)
*('All Subject Data'!$E$2:$E$5220=1000)*('All Subject Data'!$B$2:$B$5220="Male")
*('All Subject Data'!$J$2:$J$5220<>""), 'All Subject Data'!$J$2:$J$5220))
There are some empty cells but not enough to warrant such a huge difference. With hand calculations, i get like 1.4, with stdev(if....) i get like 6.41. I will try this and see if that helps.
Finally, are you aware of the difference between STDEV and STDEVP; and are you using the same one for your "hand" calculations?
Yes using the same.
Usually, that does not produce a "wildly different result". But that depends on the magnitude of the number of data that meets all criteria.
If you do not get a quick resolution of the problem, I suggest that you attach a (redacted) Excel file that demonstrates the problem.
Bookmarks