Median with multiple criteria

Eslava

Board Regular
Joined
Nov 20, 2007
Messages
112
I've been trying to get a formula that will calculate a median for base salary if it equals two criteria:
Grade: 15-8 (in column C)
Department: E or S (in column O)
the base salaries are in column I

I put the E's in Column A, S's in Column B, and the Grades in Column C of the worksheet where i need the median.

I tried the following: =MEDIAN(IF((data!$O$3:$O$200=$B10)+(data!$C$3:$C$200=$C10),data!$I$3:$I$200))

because it is such a large data set, I don't want to go in manually and calculate every median for the specific sets.

Is there a way?
 

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.
To find the median base salary, based on two conditions, try...

=MEDIAN(IF((data!$O$3:$O$200=$B10)*(data!$C$3:$C$2 00=$C10),data!$I$3:$I$200))

...confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 
Upvote 0
NYSE - Benchmark Compensation Practices 12-20-2007.xls
CDEFGHIJKLMNO
2GRADEDIVISIONDEPTNAMEJOBCODEJOBTITLEFTEANNUAL_RTMID_RT_ANNUALComp-Ratio2006Bonus2006RatingTCCDEPARTMENT
315MarketSurveillanceSpecialCounsel&TradingCorr25VicePresident(15)1.00212,800.00220,000.00.97125,000.00EE337,800.00S
415MarketSurveillanceMarketTradingAnalysis225VicePresident(15)1.00207,500.00220,000.00.9485,000.00EE292,500.00S
515MarketSurveillanceMarketTradingAnalysis125VicePresident(15)1.00201,300.00220,000.00.9275,000.00MR276,300.00S
615Enforcement&RiskEnforcement&Risk1VicePresident(15)1.00260,000.00220,000.001.181820260,000.00E
715Enforcement&RiskEnforcement1VicePresident(15)1.00200,000.00220,000.000.90909140,000.00EE340,000.00E
814MarketSurveillanceMarketSurveillance26ManagingDirector(14)1.00211,000.00175,000.001.2195,000.00EX306,000.00S
914MarketSurveillanceTradingExamination26ManagingDirector(14)1.00210,000.00175,000.001.20210,000.00S
1014MarketSurveillanceSpecialCounsel27ChiefCounsel(14)1.00192,000.00175,000.001.190,000.00EE282,000.00S
1114MarketSurveillanceMKS,ENF&Risk28ChiefAdminDeputy(14)1.00163,700.00175,000.00.94110,000.00EE273,700.00S
1214MarketSurveillanceIndustryAnalysis29Director(14)1.00189,400.00175,000.001.0845,000.00EE234,400.00S
1314MarketSurveillanceSurveillanceDevel&ITSII29Director(14)1.00189,000.00175,000.001.0895,000.00EX284,000.00S
1414MarketSurveillanceIndustryAnalysis29Director(14)1.00188,000.00175,000.001.0750,000.00MR238,000.00S
1514MarketSurveillanceSpecialistSurveillanceII29Director(14)1.00178,300.00175,000.001.0250,000.00EE228,300.00S
1614MarketSurveillanceSpecialInvestigations29Director(14)1.00170,300.00175,000.00.9740,000.00MR210,300.00S
1714MarketSurveillanceMarketSurveillance29Director(14)1.00167,400.00175,000.00.9635,000.00EE202,400.00S
1814MarketSurveillanceIndustryAnalysis29Director(14)1.00166,400.00175,000.00.9545,000.00EE211,400.00S
1914MarketSurveillanceMarketSurveillance29Director(14)1.00160,400.00175,000.00.9230,500.00EE190,900.00S
2014MarketSurveillanceTradingCorrespondence29Director(14)1.00154,800.00175,000.00.8840,000.00EE194,800.00S
2114MarketSurveillanceOn-FloorSurveillance29Director(14)1.00153,300.00175,000.00.8827,500.00MR180,800.00S
2214MarketSurveillanceSpecialProducts29Director(14)1.00151,300.00175,000.00.8622,000.00EE173,300.00S
2314MarketSurveillanceIndustryAnalysis29Director(14)1.00150,000.00175,000.00.8630,000.00EE180,000.00S
2414MarketSurveillanceIndustryAnalysis29Director(14)1.00149,100.00175,000.00.8520,000.00MR169,100.00S
2514MarketSurveillanceMemberTrading129Director(14)1.00145,000.00175,000.00.830145,000.00S
2614MarketSurveillanceMT-AuditTrailI29Director(14)1.00138,700.00175,000.00.7932,000.00MR170,700.00S
2714Enforcement&RiskEnforcement2ManagingDirectorEnforcement(14)1.00189,900.00175,000.001.0851488,000.00EE277,900.00E
2814Enforcement&RiskRisk3EnforcementDirector(14)1.00185,000.00175,000.001.057140185,000.00E
2914Enforcement&RiskTradingInv/Specialists3EnforcementDirector(14)1.00184,000.00175,000.001.0514357,000.00MR241,000.00E
3014Enforcement&RiskRisk3EnforcementDirector(14)1.00174,300.00175,000.000.99650,000.00EE224,300.00E
3114Enforcement&RiskEnforcement3EnforcementDirector(14)1.00168,600.00175,000.000.9634365,000.00EE233,600.00E
3214Enforcement&RiskTradingInvest/FloorBrokers3EnforcementDirector(14)1.00160,700.00175,000.000.9182952,000.00MR212,700.00E
data


This is the data set I am trying to get the medians from
 
Upvote 0
Please be more specific than "it did not work". Did it give you an error? Did you get the wrong answer?

Did you confirm Domenic's formula with CTRL+SHIFT+ENTER (so your formula is surrounded by { }'s in the formula bar)?
 
Upvote 0
This is where I'm trying to put the medians. It returned a #NUM error. My apologies for not being specific.
NYSE - Benchmark Compensation Practices 12-20-2007.xls
ABCDEFGH
7DepartmentGradeMidpoint(Enforcement)(Surveillance)
8($000)($000)($000)
9
10ES15$220.0
11ES14175.0
12ES13152.0
13ES12129.0
14ES11107.0
15ES1089.0
16ES974.0
17ES862.0
Exhibit 1
 
Upvote 0
For E10, it looks like you want the median base salary, where the department is either E or S, and the grade is 15. Is this correct?
 
Upvote 0
For E10, it looks like you want the median base salary, where the department is either E or S, and the grade is 15. Is this correct?

If the above is correct, try...

=MEDIAN(IF(data!$C$3:$C$200=$C10,IF((data!$O$3:$O$200=$A10)+(data!$O$3:$O$200=$B10),data!$I$3:$I$200)))

or

=MEDIAN(IF(data!$C$3:$C$200=$C10,IF(ISNUMBER(MATCH(data!$O$3:$O$200,$A10:$B10,0)),data!$I$3:$I$200)))

Note that both formulas need to be confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 
Upvote 0
Ignore Column E. Column G will contain the medians of the E's and Column H will have the S's, all according to the appropriate grade.
 
Upvote 0

Forum statistics

Threads
1,223,104
Messages
6,170,125
Members
452,303
Latest member
c4cstore

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