View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Underbooks Underbooks is offline
external usenet poster
 
Posts: 2
Default Medianif with 2 conditions

On Oct 6, 12:22*pm, Underbooks wrote:
On Oct 6, 11:49*am, Glenn wrote:



Glenn wrote:
bowriter wrote:
Hi folks,


I'm trying to find the median of a column using two conditions.


I would like to calculate the median of column M, if column G cells
are less than 1995 but not when "0" (zero) has been entered in column
M ("0"). I've tried all sorts of combinations but none work so
far.


The following formula works well but doesn't take into consideration
the "0" condition:


{=MEDIAN(IF($G$4:$G$2001995, $M$4:$M$200))}


Any help would be appreciated,


Robert


{=MEDIAN(IF(G$4:$G$2001995,IF($M$4:$M$200<0,$M$4 :$M$200)))}


Actually, I did that as "M is not equal to 0". *Drop the < if you meant "M is
greater than 0".


Hi Folks,

I should have been more specific and indeed, your formula does "work",
but I wanted to clarify:

Column M contains values from zero to various positive integers. I
need the median of those values *except* when the corresponding cell
in Column G is less 1995 *and* when the cell in Column M is 0 (zero).

That might change the formula?

~R


So:
If 1994 (column g) and 0 (it's corresponding cell in column M) = is
not calculated into the median
But:
If 1997 and and 0 = is calculated into the median