if statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
=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)
 
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
 
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")
 
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
 
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.
 
Back
Top