ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Finding Median if a value = 1.. help! (https://www.excelbanter.com/excel-worksheet-functions/12891-finding-median-if-value-%3D-1-help.html)

Greg

Finding Median if a value = 1.. help!
 
Hello,

What I'm trying to do is this: I have a worksheet that has two columns,
Gender and Age. Gender's value can be 1 or 2, 1 meaning male and 2 meaning
female. I've been trying to figure out a function that will select all
values that are 1 and taking the age from the next column and then finding
the median of those values. I've tried VLOOKUP and wierd IF functions to get
this to work, but I cannot get the correct values to be outputted.

Also, if you have any idea how to do mode and range for this same set of
data it would be greatly appreciated.

Thanks.

Biff

Hi!

Both array entered with the key combo of CTRL,SHIFT,ENTER:

=MEDIAN(IF(A1:A20=1,B1:B20))

=MODE(IF(A1:A20=1,B1:B20))

Not sure what you mean by "range"?

Biff

-----Original Message-----
Hello,

What I'm trying to do is this: I have a worksheet that

has two columns,
Gender and Age. Gender's value can be 1 or 2, 1 meaning

male and 2 meaning
female. I've been trying to figure out a function that

will select all
values that are 1 and taking the age from the next column

and then finding
the median of those values. I've tried VLOOKUP and wierd

IF functions to get
this to work, but I cannot get the correct values to be

outputted.

Also, if you have any idea how to do mode and range for

this same set of
data it would be greatly appreciated.

Thanks.
.


Biff

Hi!

If by "range" you mean the youngest/oldest:

Array entered:

=MIN(IF(A1:A20=1,B1:B20))

=MAX(IF(A1:A20=1,B1:B20))

Biff

-----Original Message-----
Hi!

Both array entered with the key combo of CTRL,SHIFT,ENTER:

=MEDIAN(IF(A1:A20=1,B1:B20))

=MODE(IF(A1:A20=1,B1:B20))

Not sure what you mean by "range"?

Biff

-----Original Message-----
Hello,

What I'm trying to do is this: I have a worksheet that

has two columns,
Gender and Age. Gender's value can be 1 or 2, 1 meaning

male and 2 meaning
female. I've been trying to figure out a function that

will select all
values that are 1 and taking the age from the next

column
and then finding
the median of those values. I've tried VLOOKUP and

wierd
IF functions to get
this to work, but I cannot get the correct values to be

outputted.

Also, if you have any idea how to do mode and range for

this same set of
data it would be greatly appreciated.

Thanks.
.

.



All times are GMT +1. The time now is 07:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com