I'm trying to create a formula which calculates an average for array 2 if another the values from array 1 are within a percentile range, the values are based on the same year, and the state matches parameter #2.
I've tried several different versions of the percentrank to identify the percentile but hit a roadblock when I tried to apply it with the averaging function.
I used the formula below to identify the percentile for each state and year.
{=PERCENTRANK.INC(IF((Data!$D$2:$D$15533=G$4)*(Data!$AT$2:$AT$15533=!$B5)*(Data!$H$2:$H$15533<>"")*(Data!$H$2:$H$15533<>0),Data!$H$2:$H$15533),C5)}
Will someone please help me apply the average function?
Thank you for the help
The excel example below attempts to illustrate what I'm trying to solve and the inputs:
[TABLE="class: grid, width: 585"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD] Year [/TD]
[TD="align: right"]2010[/TD]
[TD]Parameter #1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] State [/TD]
[TD="align: right"]3[/TD]
[TD]Parameter #2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] Field 1 # [/TD]
[TD="align: right"]40[/TD]
[TD]Defines the midpoint in the range (Parameter #3)[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] Average of Percentile Range [/TD]
[TD="align: right"]68.0%[/TD]
[TD]<--- Objective function[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"] Year [/TD]
[TD="align: center"] Field: state[/TD]
[TD="align: center"] Field 1 [/TD]
[TD="align: center"]Field 2[/TD]
[/TR]
[TR]
[TD="align: center"]2011[/TD]
[TD="align: center"] 1[/TD]
[TD="align: center"] 5[/TD]
[TD="align: center"]51.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 1[/TD]
[TD="align: center"] 10[/TD]
[TD="align: center"]37.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2011[/TD]
[TD="align: center"] 1[/TD]
[TD="align: center"] 15[/TD]
[TD="align: center"]24.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 3[/TD]
[TD="align: center"] 20[/TD]
[TD="align: center"]8.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 2[/TD]
[TD="align: center"] 25[/TD]
[TD="align: center"]79.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2011[/TD]
[TD="align: center"] 3[/TD]
[TD="align: center"] 30[/TD]
[TD="align: center"]16.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 3[/TD]
[TD="align: center"] 35[/TD]
[TD="align: center"]48.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 1[/TD]
[TD="align: center"] 40[/TD]
[TD="align: center"]62.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 3[/TD]
[TD="align: center"] 45[/TD]
[TD="align: center"]88.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 2[/TD]
[TD="align: center"] 50[/TD]
[TD="align: center"]83.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2012[/TD]
[TD="align: center"] 1[/TD]
[TD="align: center"] 55[/TD]
[TD="align: center"]1.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2011[/TD]
[TD="align: center"] 1[/TD]
[TD="align: center"] 60[/TD]
[TD="align: center"]11.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 3[/TD]
[TD="align: center"] 65[/TD]
[TD="align: center"]2.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2012[/TD]
[TD="align: center"] 2[/TD]
[TD="align: center"] 70[/TD]
[TD="align: center"]51.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2012[/TD]
[TD="align: center"] 2[/TD]
[TD="align: center"] 75[/TD]
[TD="align: center"]9.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 1[/TD]
[TD="align: center"] 80[/TD]
[TD="align: center"]86.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2011[/TD]
[TD="align: center"] 2[/TD]
[TD="align: center"] 85[/TD]
[TD="align: center"]50.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2012[/TD]
[TD="align: center"] 2[/TD]
[TD="align: center"] 90[/TD]
[TD="align: center"]90.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2011[/TD]
[TD="align: center"] 2[/TD]
[TD="align: center"] 95[/TD]
[TD="align: center"]41.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 3[/TD]
[TD="align: center"] 100[/TD]
[TD="align: center"]7.0%[/TD]
[/TR]
</tbody>[/TABLE]
I've tried several different versions of the percentrank to identify the percentile but hit a roadblock when I tried to apply it with the averaging function.
I used the formula below to identify the percentile for each state and year.
{=PERCENTRANK.INC(IF((Data!$D$2:$D$15533=G$4)*(Data!$AT$2:$AT$15533=!$B5)*(Data!$H$2:$H$15533<>"")*(Data!$H$2:$H$15533<>0),Data!$H$2:$H$15533),C5)}
Will someone please help me apply the average function?
Thank you for the help
The excel example below attempts to illustrate what I'm trying to solve and the inputs:
[TABLE="class: grid, width: 585"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD][/TD]
[TD] Year [/TD]
[TD="align: right"]2010[/TD]
[TD]Parameter #1[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] State [/TD]
[TD="align: right"]3[/TD]
[TD]Parameter #2[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] Field 1 # [/TD]
[TD="align: right"]40[/TD]
[TD]Defines the midpoint in the range (Parameter #3)[/TD]
[/TR]
[TR]
[TD][/TD]
[TD] Average of Percentile Range [/TD]
[TD="align: right"]68.0%[/TD]
[TD]<--- Objective function[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"] Year [/TD]
[TD="align: center"] Field: state[/TD]
[TD="align: center"] Field 1 [/TD]
[TD="align: center"]Field 2[/TD]
[/TR]
[TR]
[TD="align: center"]2011[/TD]
[TD="align: center"] 1[/TD]
[TD="align: center"] 5[/TD]
[TD="align: center"]51.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 1[/TD]
[TD="align: center"] 10[/TD]
[TD="align: center"]37.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2011[/TD]
[TD="align: center"] 1[/TD]
[TD="align: center"] 15[/TD]
[TD="align: center"]24.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 3[/TD]
[TD="align: center"] 20[/TD]
[TD="align: center"]8.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 2[/TD]
[TD="align: center"] 25[/TD]
[TD="align: center"]79.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2011[/TD]
[TD="align: center"] 3[/TD]
[TD="align: center"] 30[/TD]
[TD="align: center"]16.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 3[/TD]
[TD="align: center"] 35[/TD]
[TD="align: center"]48.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 1[/TD]
[TD="align: center"] 40[/TD]
[TD="align: center"]62.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 3[/TD]
[TD="align: center"] 45[/TD]
[TD="align: center"]88.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 2[/TD]
[TD="align: center"] 50[/TD]
[TD="align: center"]83.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2012[/TD]
[TD="align: center"] 1[/TD]
[TD="align: center"] 55[/TD]
[TD="align: center"]1.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2011[/TD]
[TD="align: center"] 1[/TD]
[TD="align: center"] 60[/TD]
[TD="align: center"]11.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 3[/TD]
[TD="align: center"] 65[/TD]
[TD="align: center"]2.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2012[/TD]
[TD="align: center"] 2[/TD]
[TD="align: center"] 70[/TD]
[TD="align: center"]51.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2012[/TD]
[TD="align: center"] 2[/TD]
[TD="align: center"] 75[/TD]
[TD="align: center"]9.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 1[/TD]
[TD="align: center"] 80[/TD]
[TD="align: center"]86.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2011[/TD]
[TD="align: center"] 2[/TD]
[TD="align: center"] 85[/TD]
[TD="align: center"]50.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2012[/TD]
[TD="align: center"] 2[/TD]
[TD="align: center"] 90[/TD]
[TD="align: center"]90.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2011[/TD]
[TD="align: center"] 2[/TD]
[TD="align: center"] 95[/TD]
[TD="align: center"]41.0%[/TD]
[/TR]
[TR]
[TD="align: center"]2010[/TD]
[TD="align: center"] 3[/TD]
[TD="align: center"] 100[/TD]
[TD="align: center"]7.0%[/TD]
[/TR]
</tbody>[/TABLE]