Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Medianif with 2 conditions

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default Medianif with 2 conditions

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)))}
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Medianif with 2 conditions

The trick is to multiple your truth arrays, creating a single true/false
array output. Input this array* formula:

=MEDIAN(IF((G4:G200<1995)*(M4:M2000),M4:M200))

*Use Ctrl+Shift+Enter to confirm formula, not just enter.

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"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

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default Medianif with 2 conditions

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".
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Medianif with 2 conditions

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



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default Medianif with 2 conditions

Ah, thanks for clarification. Rewritten formula (still an array)

=MEDIAN(IF((G4:G200<1995)*(M4:M200=0),"x",M4:M200) )

Formula now spits out an "x" for values that are to be ignored in the MEDIAN
function.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Underbooks" wrote:

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

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default Medianif with 2 conditions

Underbooks wrote:
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



Clear as mud now...

Which statement (if any) is correct:

1. Include rows where G1995 or M=0
2. Include rows where G1995 or M<0
3. Include rows where G1995 and M=0
4. Include rows where G1995 and M<0
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Medianif with 2 conditions

On Oct 6, 1:10*pm, Luke M wrote:
Ah, thanks for clarification. Rewritten formula (still an array)

=MEDIAN(IF((G4:G200<1995)*(M4:M200=0),"x",M4:M200) )

Formula now spits out an "x" for values that are to be ignored in the MEDIAN
function.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*



"Underbooks" wrote:
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- Hide quoted text -


- Show quoted text -


Luke:

That's perfect!! Works like a charm (I would've never come up with
that "x" vaules thing): thank you again and sorry it was a bit
confusing.

Thanks all,

Robert

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
Is there a medianif similar to averageif justnike4 Excel Worksheet Functions 4 April 5th 23 02:48 PM
Countif Conditions - Use of conditions that vary by cell value JonTarg Excel Discussion (Misc queries) 1 May 30th 08 01:21 PM
Is there any way to get an AVERAGEIF & MEDIANIF function in Exce TinaMo Excel Worksheet Functions 7 April 23rd 08 05:19 PM
Medianif & cell reference operators kcbannon Excel Worksheet Functions 4 December 5th 06 03:11 PM
"MEDIANIF" Array combining two ranges Ronny Hamida Excel Worksheet Functions 2 December 6th 05 04:50 PM


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