Median IF range of data

dstreff

New Member
Joined
Sep 12, 2017
Messages
2
I am trying to take the median of a range of values, filtered by the number in the limit column.

As small subset of the data is below.

For example, I need to write a function that finds the median of all the values for records with a Limit of 500.

In this subset of data the function should return 2590

I tried using =MEDIAN(IF(F2:F5=500,B2:E5)) and using the Ctrl+Alt+Enter method for arrays, but got the wrong answer.

Any help would be much appreciated.

[TABLE="width: 500"]
<tbody>[TR]
[TD]Record[/TD]
[TD]Value 1[/TD]
[TD]Value2[/TD]
[TD]Value3[/TD]
[TD]Value4[/TD]
[TD]Limit[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1392[/TD]
[TD]1496[/TD]
[TD]2638[/TD]
[TD][/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1412[/TD]
[TD]1496[/TD]
[TD]2643[/TD]
[TD][/TD]
[TD]1000[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1520[/TD]
[TD]1538[/TD]
[TD]2658[/TD]
[TD]3036[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]2062[/TD]
[TD]2590[/TD]
[TD]3826[/TD]
[TD]10842[/TD]
[TD]500[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Its because the blank cells will count as a zero:

=MEDIAN(IF(F2:F5=500,IF(LEN(B2:E5)>0,B2:E5)))
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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