ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   if statement (https://www.excelbanter.com/new-users-excel/84481-if-statement.html)

Sue

if statement
 
I need to flag ee who are between the ages of 20-29, 30-39, 40-49, 50-59, and
60-69

what would the formual look like just using years eg born between 1976 and
1967 etc...

Thank you
hopeless

Bob Phillips

if statement
 
=CHOOSE(INT(I4/10),"","20-29","30-39","40-49","50-59","60-69")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Sue" wrote in message
...
I need to flag ee who are between the ages of 20-29, 30-39, 40-49, 50-59,

and
60-69

what would the formual look like just using years eg born between 1976 and
1967 etc...

Thank you
hopeless




Sue

if statement
 
Hi Bob,
It didn't seem to work.

my problem is this:

someone born in year "1972", I need an if statement to calculate that this
would be someone between "30-39"

Unless I was suppose to substitute something the the formula that you gave
me. If so please talk me through it...I'm kinda new at these "if statement".

Thank you
Sue

"Bob Phillips" wrote:

=CHOOSE(INT(I4/10),"","20-29","30-39","40-49","50-59","60-69")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Sue" wrote in message
...
I need to flag ee who are between the ages of 20-29, 30-39, 40-49, 50-59,

and
60-69

what would the formual look like just using years eg born between 1976 and
1967 etc...

Thank you
hopeless





JE McGimpsey

if statement
 
You haven't explained what the data you have in your sheet is - is it a
birthdate (e.g., an Excel date serial number), a numeric year (e.g., an
integer like 1972), or a text value, like "1972".


If it's a birthdate:

A1: <birthdate
B1: =CHOOSE(DATEDIF(A1,TODAY(),"y")/10+1, "0-9", "10-19", "20-29",
"30-39", "40-49", "50-59", "60-69")


If it's a numeric year:

B1: =CHOOSE((YEAR(TODAY())-A1)/10+1, "0-9", "10-19", "20-29",
"30-39", "40-49", "50-59", "60-69")


In article ,
Sue wrote:

Hi Bob,
It didn't seem to work.

my problem is this:

someone born in year "1972", I need an if statement to calculate that this
would be someone between "30-39"

Unless I was suppose to substitute something the the formula that you gave
me. If so please talk me through it...I'm kinda new at these "if statement".


Sue

if statement
 
Thank you sorry if I wasn't clear the first time.

I am using the numeric year.

What does "totday" refer to?
I'm guessing "Year" means 2006 (if I am trying to calculate as of this year)

Thank you again
Susan

"JE McGimpsey" wrote:

You haven't explained what the data you have in your sheet is - is it a
birthdate (e.g., an Excel date serial number), a numeric year (e.g., an
integer like 1972), or a text value, like "1972".


If it's a birthdate:

A1: <birthdate
B1: =CHOOSE(DATEDIF(A1,TODAY(),"y")/10+1, "0-9", "10-19", "20-29",
"30-39", "40-49", "50-59", "60-69")


If it's a numeric year:

B1: =CHOOSE((YEAR(TODAY())-A1)/10+1, "0-9", "10-19", "20-29",
"30-39", "40-49", "50-59", "60-69")


In article ,
Sue wrote:

Hi Bob,
It didn't seem to work.

my problem is this:

someone born in year "1972", I need an if statement to calculate that this
would be someone between "30-39"

Unless I was suppose to substitute something the the formula that you gave
me. If so please talk me through it...I'm kinda new at these "if statement".



JE McGimpsey

if statement
 
TODAY() (not totday). From XL Help ("TODAY"):

TODAY
Returns the serial number of the current date.


For YEAR(), from XL Help ("YEAR"):

YEAR
Returns the year corresponding to a date. The year is returned as an
integer in the range 1900-9999.






In article ,
Sue wrote:

What does "totday" refer to?
I'm guessing "Year" means 2006 (if I am trying to calculate as of this year)



All times are GMT +1. The time now is 10:17 AM.

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