Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bri
 
Posts: n/a
Default date formula assistance req'd

I'm hoping to get help with the following worksheet formula. Given a
student's Date of Birth in, say A2, I need the formula in B2 to do the
following:

If today's date is July 1 or later, the formula needs to give the student's
age in years on Dec 31 of the current year, but if today's date is earlier
than July 1, the formula needs to give the students age in years on Dec 31
of the previous year.

eg Today is May 5, so ...
a birthdate of Mar 15, 1998 gives an age of 7 (her age as of Dec 31,
2005) and
a birthdate of Nov 10, 1998 gives an age of 7 (her age as of Dec 31,
2005)

but on Sep 1,
a birthdate of Mar 15, 1998 gives an age of 8 (her age as of Dec 31,
2006) and
a birthdate of Nov 10, 1998 gives an age of 8 (her age as of Dec 31, 2006).

Thanks, Bri




  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default date formula assistance req'd

Hi!

Try this:

=DATEDIF(A2,IF(AND(MONTH(TODAY())=7,DAY(TODAY()) =1),DATE(YEAR(TODAY()),12,31),DATE(YEAR(TODAY())-1,12,31)),"y")

Biff

"Bri" wrote in message
...
I'm hoping to get help with the following worksheet formula. Given a
student's Date of Birth in, say A2, I need the formula in B2 to do the
following:

If today's date is July 1 or later, the formula needs to give the
student's age in years on Dec 31 of the current year, but if today's date
is earlier than July 1, the formula needs to give the students age in
years on Dec 31 of the previous year.

eg Today is May 5, so ...
a birthdate of Mar 15, 1998 gives an age of 7 (her age as of Dec
31, 2005) and
a birthdate of Nov 10, 1998 gives an age of 7 (her age as of Dec
31, 2005)

but on Sep 1,
a birthdate of Mar 15, 1998 gives an age of 8 (her age as of Dec
31, 2006) and
a birthdate of Nov 10, 1998 gives an age of 8 (her age as of Dec 31,
2006).

Thanks, Bri






  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default date formula assistance req'd

One way

Assume the DOB is in A1

=IF(A1="","",DATEDIF(A1,DATE(YEAR(TODAY())+LOOKUP( MONTH(TODAY()),{0;7},{-1;0}),12,31),"y"))


--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com


"Bri" wrote in message
...
I'm hoping to get help with the following worksheet formula. Given a
student's Date of Birth in, say A2, I need the formula in B2 to do the
following:

If today's date is July 1 or later, the formula needs to give the
student's age in years on Dec 31 of the current year, but if today's date
is earlier than July 1, the formula needs to give the students age in
years on Dec 31 of the previous year.

eg Today is May 5, so ...
a birthdate of Mar 15, 1998 gives an age of 7 (her age as of Dec
31, 2005) and
a birthdate of Nov 10, 1998 gives an age of 7 (her age as of Dec
31, 2005)

but on Sep 1,
a birthdate of Mar 15, 1998 gives an age of 8 (her age as of Dec
31, 2006) and
a birthdate of Nov 10, 1998 gives an age of 8 (her age as of Dec 31,
2006).

Thanks, Bri






  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default date formula assistance req'd

After seeing Peo's formula I realize that it doesn't matter what the day is.
So this will do:

=DATEDIF(A2,IF(MONTH(TODAY())=7,DATE(YEAR(TODAY() ),12,31),DATE(YEAR(TODAY())-1,12,31)),"y")

Biff

"Biff" wrote in message
...
Hi!

Try this:

=DATEDIF(A2,IF(AND(MONTH(TODAY())=7,DAY(TODAY()) =1),DATE(YEAR(TODAY()),12,31),DATE(YEAR(TODAY())-1,12,31)),"y")

Biff

"Bri" wrote in message
...
I'm hoping to get help with the following worksheet formula. Given a
student's Date of Birth in, say A2, I need the formula in B2 to do the
following:

If today's date is July 1 or later, the formula needs to give the
student's age in years on Dec 31 of the current year, but if today's date
is earlier than July 1, the formula needs to give the students age in
years on Dec 31 of the previous year.

eg Today is May 5, so ...
a birthdate of Mar 15, 1998 gives an age of 7 (her age as of Dec
31, 2005) and
a birthdate of Nov 10, 1998 gives an age of 7 (her age as of Dec
31, 2005)

but on Sep 1,
a birthdate of Mar 15, 1998 gives an age of 8 (her age as of Dec
31, 2006) and
a birthdate of Nov 10, 1998 gives an age of 8 (her age as of Dec 31,
2006).

Thanks, Bri








  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bri
 
Posts: n/a
Default date formula assistance req'd

thanks to both
Bri

"Peo Sjoblom" wrote in message
...
One way

Assume the DOB is in A1

=IF(A1="","",DATEDIF(A1,DATE(YEAR(TODAY())+LOOKUP( MONTH(TODAY()),{0;7},{-1;0}),12,31),"y"))


--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com


"Bri" wrote in message
...
I'm hoping to get help with the following worksheet formula. Given a
student's Date of Birth in, say A2, I need the formula in B2 to do the
following:

If today's date is July 1 or later, the formula needs to give the
student's age in years on Dec 31 of the current year, but if today's date
is earlier than July 1, the formula needs to give the students age in
years on Dec 31 of the previous year.

eg Today is May 5, so ...
a birthdate of Mar 15, 1998 gives an age of 7 (her age as of Dec
31, 2005) and
a birthdate of Nov 10, 1998 gives an age of 7 (her age as of Dec
31, 2005)

but on Sep 1,
a birthdate of Mar 15, 1998 gives an age of 8 (her age as of Dec
31, 2006) and
a birthdate of Nov 10, 1998 gives an age of 8 (her age as of Dec 31,
2006).

Thanks, Bri










  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default date formula assistance req'd

This could be further refined to:

=DATEDIF(A2,DATE(YEAR(TODAY())-(MONTH(TODAY())<7),12,31),"y")

Biff

"Biff" wrote in message
...
After seeing Peo's formula I realize that it doesn't matter what the day
is. So this will do:

=DATEDIF(A2,IF(MONTH(TODAY())=7,DATE(YEAR(TODAY() ),12,31),DATE(YEAR(TODAY())-1,12,31)),"y")

Biff

"Biff" wrote in message
...
Hi!

Try this:

=DATEDIF(A2,IF(AND(MONTH(TODAY())=7,DAY(TODAY()) =1),DATE(YEAR(TODAY()),12,31),DATE(YEAR(TODAY())-1,12,31)),"y")

Biff

"Bri" wrote in message
...
I'm hoping to get help with the following worksheet formula. Given a
student's Date of Birth in, say A2, I need the formula in B2 to do the
following:

If today's date is July 1 or later, the formula needs to give the
student's age in years on Dec 31 of the current year, but if today's
date is earlier than July 1, the formula needs to give the students age
in years on Dec 31 of the previous year.

eg Today is May 5, so ...
a birthdate of Mar 15, 1998 gives an age of 7 (her age as of Dec
31, 2005) and
a birthdate of Nov 10, 1998 gives an age of 7 (her age as of Dec
31, 2005)

but on Sep 1,
a birthdate of Mar 15, 1998 gives an age of 8 (her age as of Dec
31, 2006) and
a birthdate of Nov 10, 1998 gives an age of 8 (her age as of Dec 31,
2006).

Thanks, Bri










Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Range with unused formula messing up x axis on dynamic graph [email protected] Charts and Charting in Excel 2 February 2nd 06 08:02 PM
Trending Formula Results by Date sony654 Excel Worksheet Functions 0 January 2nd 06 02:33 AM
Year-to-date year to date formula Philm Excel Worksheet Functions 1 October 7th 05 02:50 AM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 03:28 AM
Need help troubleshooting an array formula XLXP on Win2K KR Excel Worksheet Functions 1 December 13th 04 07:41 PM


All times are GMT +1. The time now is 11:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"