ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Return a value if variable is in a range (https://www.excelbanter.com/excel-discussion-misc-queries/207563-return-value-if-variable-range.html)

plally

Return a value if variable is in a range
 
I have a column that includes a number representing attained age. There are
approximately 21,000 records. I need to find the distribution of ages in
increments of 10. i.e., the number of records betwen 0 and 10, 11 and 20, 21
and 30, etc.

I've tried using an if statement in the following format:
=IF(11<=D2<=20,1,0). If D2 (attained age) is = 11 and is less than 20, give
me 1 as the value, otherwise, return 0. The statement does not seem to be
working properly.

Thanks

Mike H

Return a value if variable is in a range
 
Hi,

Create yourself a table with the age groupings in which in my case is in
columns A1 & B1 down

0 10
11 20
21 30

The put this in C1 and drag down

=COUNTIF($A$1:$A$100,"="&B1)-COUNTIF($A$1:$A$100,""&C1)

Mike

"plally" wrote:

I have a column that includes a number representing attained age. There are
approximately 21,000 records. I need to find the distribution of ages in
increments of 10. i.e., the number of records betwen 0 and 10, 11 and 20, 21
and 30, etc.

I've tried using an if statement in the following format:
=IF(11<=D2<=20,1,0). If D2 (attained age) is = 11 and is less than 20, give
me 1 as the value, otherwise, return 0. The statement does not seem to be
working properly.

Thanks


Jim Thomlinson

Return a value if variable is in a range
 
=--and(D2=11, D2<=20)
--
HTH...

Jim Thomlinson


"plally" wrote:

I have a column that includes a number representing attained age. There are
approximately 21,000 records. I need to find the distribution of ages in
increments of 10. i.e., the number of records betwen 0 and 10, 11 and 20, 21
and 30, etc.

I've tried using an if statement in the following format:
=IF(11<=D2<=20,1,0). If D2 (attained age) is = 11 and is less than 20, give
me 1 as the value, otherwise, return 0. The statement does not seem to be
working properly.

Thanks


ShaneDevenshire

Return a value if variable is in a range
 
Hi,

two ways -
1. Put the data in a pivot table and put the number field in the row area.
Place your cursor in the row field and choose Pivot Table, Group and Show
Detail, Group. The dialog box that appears is easy.
2. In a column, say D1:D10, enter the numbers
10, 20, 30...100
Select E1:E10 and type, but do not enter, the formula
=FREQUENCY(A1:A22000,D1:D10)
Press Shift+Control+Enter not enter.

--
Thanks,
Shane Devenshire


"plally" wrote:

I have a column that includes a number representing attained age. There are
approximately 21,000 records. I need to find the distribution of ages in
increments of 10. i.e., the number of records betwen 0 and 10, 11 and 20, 21
and 30, etc.

I've tried using an if statement in the following format:
=IF(11<=D2<=20,1,0). If D2 (attained age) is = 11 and is less than 20, give
me 1 as the value, otherwise, return 0. The statement does not seem to be
working properly.

Thanks



All times are GMT +1. The time now is 05:45 AM.

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