IF and Median function to return median value of all the numbers that meet certain criteria

olivierv

New Member
Joined
Jul 25, 2014
Messages
29
Hello,

I'm having a problem with a data file for which I want to return the Median value that meet certain criteria.
Suppose I want to return the median EV/EBITDA value for all companies that have more than 50% of their sales in North America for the year 2009, what is the best way to do this?

j94qog.jpg
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
=MEDIAN(IF(A1:A21=2009,IF(B1:B21>50%,G1:G21,0)))
Array formula, use Ctrl-Shift-Enter
 
Upvote 0
=MEDIAN(IF(A1:A21=2009,IF(B1:B21>50%,G1:G21,0)))
Array formula, use Ctrl-Shift-Enter

Many thanks, this works. I tried to built a new function with a nested IF function, but I can't get it right.
I used MEDIAN(IF(A1:A21=2009,IF(AND(B1:B21>50%, C1:C21>10%, D1:D22>50%), G1:G21,0))) but it keeps returning #NUM.
@Special-K99, do you have a solution or can you tell what I'm doing wrong?
 
Upvote 0

Forum statistics

Threads
1,215,338
Messages
6,124,349
Members
449,155
Latest member
ravioli44

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