Formula Help!

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

Guest

I need to create a formula to check a cell that holds a year in it and calculate if that year in comparison to the current year is between one and nineteen years, if it is I need a specific number to be produced.
For example cell a1 holds 1998 and the current year is 2004, I need a formula to calculate the number of years between 98 & 04 and if it's between 1 & 19 then "23" must be produced.... if it's 20 and above then "28" must be produced....

I've been trying to work on the "IF" formula but can't seem to figure it out, can someone please help !

Thank you,
Jenn
 
=IF(YEAR(TODAY())-A1<20,23,28)

where A1 holds the start year (1998)

--

Regards,

Peo Sjoblom


Jenn said:
I need to create a formula to check a cell that holds a year in it and
calculate if that year in comparison to the current year is between one and
nineteen years, if it is I need a specific number to be produced.
For example cell a1 holds 1998 and the current year is 2004, I need a
formula to calculate the number of years between 98 & 04 and if it's between
1 & 19 then "23" must be produced.... if it's 20 and above then "28" must be
produced....
 
Hi Jenn
try
=IF(AND(YEAR(TODAY())-A1>=1,YEAR(TODAY())-A1<=19),23,IF(YEAR(TODAY())-A
1>=20,28,"A1=current year"))
 
Jenn, here you go:

=IF(AND(YEAR(TODAY())-A1>=1,YEAR(TODAY())-A1<=19),23,28)

DDM
"DDM's Microsoft Office Tips and Tricks"
www.ddmcomputing.com

Jenn said:
I need to create a formula to check a cell that holds a year in it and
calculate if that year in comparison to the current year is between one and
nineteen years, if it is I need a specific number to be produced.
For example cell a1 holds 1998 and the current year is 2004, I need a
formula to calculate the number of years between 98 & 04 and if it's between
1 & 19 then "23" must be produced.... if it's 20 and above then "28" must be
produced....
 
If 1998 is in A1,

=IF(ABS(A1-YEAR(TODAY()))>=20,28,23)

if a date with the year 1998 is in A1,

=IF(ABS(YEAR(A1)-YEAR(TODAY()))>=20,28,23)

various assumptions were made, post back if this doesn't do it.


Jenn said:
I need to create a formula to check a cell that holds a year in it and
calculate if that year in comparison to the current year is between one and
nineteen years, if it is I need a specific number to be produced.
For example cell a1 holds 1998 and the current year is 2004, I need a
formula to calculate the number of years between 98 & 04 and if it's between
1 & 19 then "23" must be produced.... if it's 20 and above then "28" must be
produced....
 
Back
Top