Median of multiple pabs, excluding zero's

WardM

New Member
Joined
May 14, 2015
Messages
3
Dear All,

Using office 2010, i ran into a problem when i wanted to calculate the median of one cell (C13) on different tabs but exclude all the zero's.

I first tried the formula "{=Median(IF(Sheet1!C13;Sheet2!C13;...Sheet28!C<>0;Sheet1!C13;Sheet2!C13;...Sheet28!C))}"
but got the error "to many arguments for this function" i assume this is due to the ";" separating the arguments in the IF(...) part of the formula

I then tried the formula "{=Median(IF(Sheet1:Sheet28!C13<>0;Sheet1:Sheet28!C13))}" but got the error #REF!. I assume this is due to the fact that "Sheet1:Sheet24!C13" is not a valid reference. I tried to find an alternative but did not succeed and i am afraid this is due to the fact that the IF() formula may not handle 3-D references.

I am not acquainted with User Defined Functions (UDF) but i think it is the only solution?

Could you help me with finding a solution? Any help and advice is appreciated!

Best, Ward
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
A third attempt was with this formula
"{=MEDIAN(IF({"AT";"BE";"BG";"HR";"CY";"CZ";"DK";"EE";"FI";"FR";"DE";"GR";"HU";"IE";"IT";"LV";"LT";"LU";"MT";"NL";"PL";"PT";"RO";"SK";"SI";"ES";"SE";"UK"}&"!D13">0;{"AT";"BE";"BG";"HR";"CY";"CZ";"DK";"EE";"FI";"FR";"DE";"GR";"HU";"IE";"IT";"LV";"LT";"LU";"MT";"NL";"PL";"PT";"RO";"SK";"SI";"ES";"SE";"UK"}&"!D13"))}"
But that failed as wel as i got the #NUM! error message, and i think the {"AT";"BE";"BG";"HR";"CY";"CZ";"DK";"EE";"FI";"FR";"DE";"GR";"HU";"IE";"IT";"LV";"LT";"LU";"MT";"NL";"PL";"PT";"RO";"SK";"SI";"ES";"SE";"UK"}&"!D13" reference is not recognized as valid.
 
Upvote 0
Hi.

Assuming the values in those cells are always non-negative:

=PERCENTILE.INC(Sheet1:Sheet7!C13,1/2+INDEX(FREQUENCY(Sheet1:Sheet7!C13,0),1)/(2*(SUM(FREQUENCY(Sheet1:Sheet7!C13,0))-1)))

Replace Sheet1:Sheet7 appropriately.

Actually, if the number of sheets in question is fixed, the construction used for the denominator can be replaced with a static value n:

=PERCENTILE.INC(Sheet1:Sheet7!C13,1/2+INDEX(FREQUENCY(Sheet1:Sheet7!C13,0),1)/n

where:

n = 2 x (Number of Sheets - 1)

(Which in my example would evaluate to 12.)

Regards
 
Upvote 0
Hi XOR LX,

It worked, thank you! I don't know if i would have been able to figure this out myself even if i would have spend ages on the problem, thank you very much!

Best regards,

Ward
 
Upvote 0
Using a rather classical approach, control+shift+enter, not just enter:

=MEDIAN(IF(ISNUMBER(1/N(INDIRECT("'"&SheetList&"'!C13"))),N(INDIRECT("'"&SheetList&"'!C13"))))

where SheetList refers to a range that lists all of the relevant data sheets one by one.
 
Upvote 0

Forum statistics

Threads
1,216,144
Messages
6,129,120
Members
449,488
Latest member
qh017

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