#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Group by

I have a column of dates and a column of durations. I have used a pivot
table to work out the average duration by month. However, I also need to
calculate the average after excluding the highest durations for each month.
I have tried PERCENTRANK which works OK for the whole column but I can't
figure out how to group it by month. I also don't want to have to have a
column for each month using lookup or match.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Group by

I need to exclude the top 20% of durations rather than a fixed number.

"mcquam" wrote:

I have a column of dates and a column of durations. I have used a pivot
table to work out the average duration by month. However, I also need to
calculate the average after excluding the highest durations for each month.
I have tried PERCENTRANK which works OK for the whole column but I can't
figure out how to group it by month. I also don't want to have to have a
column for each month using lookup or match.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,180
Default Group by

Using Pivot Table and Percentrank:
http://www.savefile.com/files/1582656
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Group by



"Herbert Seidenberg" wrote:

Using Pivot Table and Percentrank:
http://www.savefile.com/files/1582656

What a wonderfully elegant solution! I'd be really grateful if you would
explain what Date R does in: =PERCENTRANK(IF(MONTH(Date)=MONTH(Date
R),Duration),IF(MONTH(Date)=MONTH(Date R),Duration),2).
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,180
Default Group by

Date R refers to the intersection of the defined range Date
and the row of that cell.
A space in a formula works as an Intersection Operator.
Tools Options General R1C1 Reference Style (uncheck)
will convert the expression into a more familiar style.


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Group by



Many thanks, i think i've got it now and i have it working nicely on my
spreadsheet. i do have a question though. My results were not exactly as i
expected. For example, using your data, you have 23 entries for January 08,
so I would expect 4 or 5 records to represent 20% (depending on rounding).
Your figures show 7 records, or around 30%. Have I picked you up wrong?
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,180
Default Group by

Use this formula instead:

=1-(SUMPRODUCT(--((MONTH(Date)=MONTH(Date R))
*Duration=Duration R))-1)
/(SUMPRODUCT(--(MONTH(Date)=MONTH(Date R)))-1)

http://www.savefile.com/files/1585335
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Group by



Thank you very much. I'm sorry to come back again but the formula resloves
to div/0 if there is only one date. If I simply exclude the error, it
incorrectly assumes it is above 80%.
  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,180
Default Group by

On Jun 2, 1:36 am, mcquam wrote:
Thank you very much. I'm sorry to come back again but the formula resloves
to div/0 if there is only one date. If I simply exclude the error, it
incorrectly assumes it is above 80%.


  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,180
Default Group by

Add another Pivot Table
http://www.savefile.com/files/1586123


  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Group by


Absolutely brilliant. I can't thank you enough.
  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Percentrank Query in Excel

Hi, Not sure if i am in the right spot but i am in a real bind and hoping someone can assist.

I have a sheet containing 2 Columns of Data Column A Job Title and C is Salary.

A B
Elec $8
Plumber $12
Tech $10
Elec $76
Plumber $22
Tech $56

I can easily percentrank the total of all salaries by using the following
=percentrank(B1:B150,B1) however;

I need to percentrank the titles rather than the total of all such as percentrank of all "Tech's".

I have tried If and Sumproduct but neither provide the result.

Any help appreciated.

Many thanks
Peter
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
Copy Data from One Group of Cells to Another Group Alan Auerbach Charts and Charting in Excel 2 May 27th 07 04:12 PM
I wish to group my worksheets under group tabs CSI Excel Worksheet Functions 5 October 19th 06 09:25 PM
How can I convert a group of numbers to a group of letters? CarlG Excel Worksheet Functions 9 August 18th 06 03:31 PM
Taking age group Ie ages 20-29 and picking out net sales for group viabello Excel Worksheet Functions 1 April 25th 06 04:19 AM
How do I group worksheets (Lotus 123 function is "Sheet>Group Shee jaking Excel Worksheet Functions 2 August 30th 05 02:09 PM


All times are GMT +1. The time now is 09:10 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"