Average cells meeting a criteria

msampson

Board Regular
Joined
Mar 9, 2004
Messages
129
Office Version
  1. 365
Platform
  1. MacOS
I have a table that is 6 rows by 30, so 180 cells. I was able to do a lookup so that I now have a column of values and next to it a column which says which cell it belongs to. I can do a countif on the second column to see how many values in each cell. But what I want to do is the average value (from the first column) of each cell (listed in the second column).
How can I do averageif to only average the values belonging to each cell.

A....B
10..6
2....120
6.....3
12....6

so in this case it would only average the 10 and 12 in the first and last rows.
I've made a new column that has 180 rows to correspond to each cell so I'd like to copy down the formula to get the average in each of the 180 cells.
Maureen
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Care to clarify your set up by posting a scaled-down example along with the desired results for that sample?
 
Upvote 0
I figured out how to use the averageif function. Now, is there a way to calculate median with the same type of criteria? I see countif and sumif but not others like that.
 
Upvote 0
I figured out how to use the averageif function. Now, is there a way to calculate median with the same type of criteria? I see countif and sumif but not others like that.

Control+shift+enter, not just enter:

=MEDIAN(IF(ConditionRange=Condition,MeadianRange))
 
Upvote 0
I've been using this a lot in my current project and have adapted it to average and mode. But now I need to use the same conditional criteria to define the range and return the percentilerank of a number from within that range. The formula for a plain Percentilerank has it's own range and then a location of the number that you want the percentilerank for. How can I adapt the above formula to add the one extra parameter?
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,393
Members
449,081
Latest member
JAMES KECULAH

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