Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Median Calculation

I am summarizing a large amount of compensation data using pivot reports and
need to include the median. I do not think median is available for use in
pivot tables or when even just subtotaling data - what would be the best way
to quickly find medians for many different groupings in a large amount of
data?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Median Calculation

One way to get at it is via using conditional, array-entered* expressions
like this:
=MEDIAN(IF((A$2:A$10="Dept1")*(B$2:B$10="Assoc"),C $2:C$10))
*press CTRL+SHIFT+ENTER to confirm the formula(not just ENTER)

The above derives the median salary of staff of rank: Assoc in Dept1,
assuming col C houses the salary data. You can point to cells housing the
various params for dept and rank (eg params in 2 cols) instead of it being
hardcoded in the example, and hence easily propagate the expression down to
derive all the various results.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---
"SB Lee" wrote:
I am summarizing a large amount of compensation data using pivot reports and
need to include the median. I do not think median is available for use in
pivot tables or when even just subtotaling data - what would be the best way
to quickly find medians for many different groupings in a large amount of
data?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Median Calculation

Thank you. The piece I am not clear on is how to create the formula without
hard coding the params. The data I need to use to identify the median is in
2 columns - column A has job title and column B has salary - there are
approximately 1000 different job titles that I need to find the medians for.

"Max" wrote:

One way to get at it is via using conditional, array-entered* expressions
like this:
=MEDIAN(IF((A$2:A$10="Dept1")*(B$2:B$10="Assoc"),C $2:C$10))
*press CTRL+SHIFT+ENTER to confirm the formula(not just ENTER)

The above derives the median salary of staff of rank: Assoc in Dept1,
assuming col C houses the salary data. You can point to cells housing the
various params for dept and rank (eg params in 2 cols) instead of it being
hardcoded in the example, and hence easily propagate the expression down to
derive all the various results.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---
"SB Lee" wrote:
I am summarizing a large amount of compensation data using pivot reports and
need to include the median. I do not think median is available for use in
pivot tables or when even just subtotaling data - what would be the best way
to quickly find medians for many different groupings in a large amount of
data?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Median Calculation

Assume job titles and salary data are in Sheet1's cols A and C, in row2 down.
Do a quick pivot just on that job titles col, place the col header in the ROW
and DATA area (set to count). The pivot will return the list of all the
unique job titles and its corresponding counts in a new sheet. In that pivot
sheet, assume the unique job titles are listed in A5 down. Use an adjacent
col outside the pivot, say C5,
place this and array-enter:
=MEDIAN(IF(Sheet1!A$2:A$5000=A5,Sheet1!C$2:C$5000) )
Copy down to return the required results for each unique job title
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---
"SB Lee" wrote:
Thank you. The piece I am not clear on is how to create the formula without
hard coding the params. The data I need to use to identify the median is in
2 columns - column A has job title and column B has salary - there are
approximately 1000 different job titles that I need to find the medians for.


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Median Calculation

I created the pivot table as you stated and am using the following formula
but it is just bringing back o's. =MEDIAN(IF('Census by
Title'!E$2:E$3251=A5,'Census by Title'!Q$2:Q$3251))


"Max" wrote:

Assume job titles and salary data are in Sheet1's cols A and C, in row2 down.
Do a quick pivot just on that job titles col, place the col header in the ROW
and DATA area (set to count). The pivot will return the list of all the
unique job titles and its corresponding counts in a new sheet. In that pivot
sheet, assume the unique job titles are listed in A5 down. Use an adjacent
col outside the pivot, say C5,
place this and array-enter:
=MEDIAN(IF(Sheet1!A$2:A$5000=A5,Sheet1!C$2:C$5000) )
Copy down to return the required results for each unique job title
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---
"SB Lee" wrote:
Thank you. The piece I am not clear on is how to create the formula without
hard coding the params. The data I need to use to identify the median is in
2 columns - column A has job title and column B has salary - there are
approximately 1000 different job titles that I need to find the medians for.




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Median Calculation

It should have worked. Probably your source data is not cleansed, and the
source col Q may contain text nums. Try this heavier duty adaptation of your
expression which takes care of all possibilities, array-entered:
=MEDIAN(IF(TRIM('Census by Title'!E$2:E$3251)=TRIM(A5),'Census by
Title'!Q$2:Q$3251+0))

Success, finally? Click the YES button below.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---
"SB Lee" wrote:
I created the pivot table as you stated and am using the following formula
but it is just bringing back o's. =MEDIAN(IF('Census by
Title'!E$2:E$3251=A5,'Census by Title'!Q$2:Q$3251))


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Median Calculation

I just must be doing something wrong because the 2nd and 3rd rows returned a
value but the rest are zero.

"Max" wrote:

It should have worked. Probably your source data is not cleansed, and the
source col Q may contain text nums. Try this heavier duty adaptation of your
expression which takes care of all possibilities, array-entered:
=MEDIAN(IF(TRIM('Census by Title'!E$2:E$3251)=TRIM(A5),'Census by
Title'!Q$2:Q$3251+0))

Success, finally? Click the YES button below.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---
"SB Lee" wrote:
I created the pivot table as you stated and am using the following formula
but it is just bringing back o's. =MEDIAN(IF('Census by
Title'!E$2:E$3251=A5,'Census by Title'!Q$2:Q$3251))


  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Median Calculation

"SB Lee" wrote:
I just must be doing something wrong because the 2nd and 3rd rows returned a
value but the rest are zero.


I don't know. The expressions given should work fine. You'd have to re-check
carefully your source data, eg in col Q there could be some non-numerics
(text, not text nums), residual errors? etc. Use the autofilter droplist on
col Q to quick-screen through the list and rectify.
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:25,000 Files:300 Subscribers:70
xdemechanik
---
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Median calculation of grouped data. Bruce Excel Worksheet Functions 19 April 25th 23 03:46 AM
median calculation Pammy Excel Discussion (Misc queries) 2 November 16th 07 06:49 PM
Median reno Excel Discussion (Misc queries) 3 August 21st 07 08:12 PM
Max/Min/Median gibsol Excel Worksheet Functions 3 February 28th 07 03:22 PM
Median calculation and ignore zeros coastal Excel Discussion (Misc queries) 5 February 12th 07 11:27 PM


All times are GMT +1. The time now is 04:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"