#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jason
 
Posts: n/a
Default SumIF

I would like to be able to use the same type of functionallity given with the
sum if function, but instead of returning the sum, return the median? Some
example data follows:

Column A Column B
B1 175
B1 200
B1 225

I would like the formula to use Column A as the column to evaluate, and
return the median of column B based on the criteria (in this case it would be
the median of 200 for the values in column B based on B1 in column A

Any ideas? Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max
 
Posts: n/a
Default SumIF

One set-up to try ..

Assume data would be in cols A and B,
from row1 down till row100 (expected max extent)

Put in D1:
=IF(A1="","",IF(COUNTIF($A$1:A1,A1)1,"",ROW()))

Put in E1:
=IF(ISERROR(SMALL(D:D,ROW(A1))),"",
INDEX(A:A,MATCH(SMALL(D:D,ROW(A1)),D:D,0)))

Select D1:E1, copy down to E100

Col E extracts the list of uniques in col A

Put in F1, array-enter (press CTRL+SHIFT+ENTER):
=IF(E1="","",MEDIAN(IF(($A$1:$A$100=E1)*($A$1:$A$1 00<0),$B$1:$B$100)))

Copy F1 down until the last row of uniques extracted in col E

Col F returns the desired results for each of the uniques in col E

Adapt to suit ..
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Jason" wrote in message
...
I would like to be able to use the same type of functionallity given with

the
sum if function, but instead of returning the sum, return the median?

Some
example data follows:

Column A Column B
B1 175
B1 200
B1 225

I would like the formula to use Column A as the column to evaluate, and
return the median of column B based on the criteria (in this case it would

be
the median of 200 for the values in column B based on B1 in column A

Any ideas? Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roland
 
Posts: n/a
Default SumIF

Jason

With your data, assuming headings in row 1 and data beginning in row 2, use
in cell C2

=MEDIAN(IF(A$1:A$99=A2,B$1:B$9))

Now the catch. This is to be an array formula.

Instead of using ENTER to enter the formula, use

CTRL-SHIFT-ENTER.

You should then see curly braces {} around the formula.

{=MEDIAN(IF(A$1:A$99=A2,B$1:B$9))}




"Jason" wrote:

I would like to be able to use the same type of functionallity given with the
sum if function, but instead of returning the sum, return the median? Some
example data follows:

Column A Column B
B1 175
B1 200
B1 225

I would like the formula to use Column A as the column to evaluate, and
return the median of column B based on the criteria (in this case it would be
the median of 200 for the values in column B based on B1 in column A

Any ideas? Thanks.

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
How to use SUMIF to return sums between two values located in cells ScottBerger Excel Worksheet Functions 2 April 23rd 23 09:05 PM
sumif based on vlookup array Brian Winkler Excel Worksheet Functions 6 October 16th 05 01:52 PM
Embedding a Sumif in a sumif C.Pflugrath Excel Worksheet Functions 5 August 31st 05 07:31 PM
SUMIF with Mutiple Ranges & Criteria PokerZan Excel Discussion (Misc queries) 5 August 4th 05 10:31 PM
SUMIF - Range name to used for the "sum_range" portion of a SUMIF function Oscar Excel Worksheet Functions 2 January 11th 05 11:01 PM


All times are GMT +1. The time now is 06:09 PM.

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

About Us

"It's about Microsoft Excel"