Excel Function STDEV.P IF AND Nested Equation #VALUE

112 Views Asked by At

I'm attempting to run a STDEV.P on a specific population that has 3 criteria. I did this with AVERAGEIFS and it worked perfectly.

Here's the equation I have:

{=STDEV.P(IF((Adjusted_Player_Data!A:A=Sim_FG!A3,Adjusted_Player_Data!AK:AK=SImulated_Outcome!H3),Adjusted_Player_Data!K:K,""))}

Adjusted_Player_Data!A:A is a player name list
Sim_FG!A3 is the player I'm looking up
Player_Data!AK:AK is the scale names (Low, Med, High)
Simluated_Outcome!H3 is the scale I am trying to match. 
Adjusted!K:K is the range I am running the STDEV.P against. 

Basically I need to match player and scale from big list. My averageifs function works perfectly and this is what it is: =IF(SImulated_Outcome!M2="Y",AVERAGEIFS(Adjusted_Player_Data!K:K,Adjusted_Player_Data!A:A,Sim_FG!A3,Adjusted_Player_Data!AK:AK,SImulated_Outcome!H3),"")

I've found answer below on nesting but now I want to include another criteria. If M2=Y then run a similar STDEV.

=IF(SImulated_Outcome!M2="Y",STDEV.P(IF(Adjusted_Player_Data!A:A=Sim_FG!A3,IF(Adjusted_Player_Data!AK:AK=SImulated_Outcome!H3,IF(Adjusted_Player_Data!AP:AP=1,Adjusted_Player_Data!K:K),STDEV.P(IF(Adjusted_Player_Data!A:A=Sim_FG!A3,IF(Adjusted_Player_Data!AK:AK=SImulated_Outcome!H3,IF(Adjusted_Player_Data!AP:AP=0,Adjusted_Player_Data!K:K))))))))

2

There are 2 best solutions below

2
xidgel On BEST ANSWER

You need to use nested IFs in STDEV.P:

=STDEV.P(IF(Adjusted_Player_Data!A:A=Sim_FG!A3,IF(Adjusted_Player_Data!AK:AK=SImulated_Outcome!H3,Adjusted_Player_Data!K:K,""),""))
1
xidgel On

For your follow-up question, your closing parentheses ) are in the wrong place. I think this is what you want:

=IF(SImulated_Outcome!M2="Y",
   STDEV.P(IF(Adjusted_Player_Data!A:A=Sim_FG!A3,IF(Adjusted_Player_Data!AK:AK=SImulated_Outcome!H3,IF(Adjusted_Player_Data!AP:AP=1,Adjusted_Player_Data!K:K)))),
   STDEV.P(IF(Adjusted_Player_Data!A:A=Sim_FG!A3,IF(Adjusted_Player_Data!AK:AK=SImulated_Outcome!H3,IF(Adjusted_Player_Data!AP:AP=0,Adjusted_Player_Data!K:K)))))