Averaging with N/A?

santafe

New Member
Joined
Jan 21, 2020
Messages
7
Office Version
  1. 365
Platform
  1. Windows
I think I need an array formula for this, but I haven't been able to figure that part out.
Example: column A has whole number values, column B has percents.
My equation is: =AverageIf(A6:A50,">"&Percentile(B6:B50,0.9))
I'm trying to take the top 10th percentile of the percentage column and return the average of the whole number column, but if the whole number has an N/A then I get the Div/0 error. How do I fix this?

Second Question: column A has whole numbers, column B has percents, column C has word values (Cat, Dog, Bird)
How do I write an equation that will only return the average of column A for only the top 10th percentile (from column B) and only include Cats?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
See if you have aggregate function?

=AVERAGEIFS(A6:A50,B6:B50,">"&AGGREGATE(16,6,B6:B50,0.9))
 
Upvote 0
thank you!! This is great.

Any chance you know how to solve the second question?
 
Upvote 0
It depends. Are you calculating the percentile before you involve the cats or after?
 
Upvote 0
I'm trying to say: 1/ only look at the rows labeled Cats, 2/ now only look at the top decile of Column B, of this top decile what's the average of Column A?
 
Upvote 0
Try one of these which are slightly different:

=AVERAGEIFS(A6:A50,B6:B50,">"&AGGREGATE(16,6,B6:B50,0.9),C6:C50,"Cats")
=AVERAGEIFS(A6:A50,B6:B50,">"&AGGREGATE(16,6,B6:B50/(C6:C50="Cats"),0.9))

Im guesssing you need the 2nd one.
 
Upvote 0
Actually thinking about it this:

=AVERAGEIFS(A6:A50,B6:B50,">"&AGGREGATE(16,6,B6:B50/(C6:C50="Cats"),0.9),C6:C50,"Cats")

This calculates the percentile based on if Cats is in column C firstly. It then produces the average of column A if column B is greater than the percentile number and column C equals Cats.
 
Upvote 0

Forum statistics

Threads
1,214,518
Messages
6,119,988
Members
448,935
Latest member
ijat

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