Average based on the Percentile and two other parameters

wtsabo

New Member
Joined
Mar 3, 2010
Messages
39
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]
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

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