#1   Report Post  
cassandra
 
Posts: n/a
Default If statements


I have if statement to get the current age. but if there is DOB is
blank the current age is 105.

DOB is D4 and the if statement is in Current age D5

=IF(MONTH(TODAY())MONTH(D4),YEAR(TODAY())-YEAR(D4),
IF(AND(MONTH(TODAY())=MONTH(D4),DAY(TODAY())=DAY( D4)),
YEAR(TODAY())-YEAR(D4),(YEAR(TODAY())-YEAR(D4))-1))



What if statment should i use to get Current age to be blank until
there is a date entered in the DOB.


Thanks


--
cassandra
------------------------------------------------------------------------
cassandra's Profile: http://www.excelforum.com/member.php...o&userid=27026
View this thread: http://www.excelforum.com/showthread...hreadid=438908

  #2   Report Post  
Trevor Shuttleworth
 
Posts: n/a
Default

Cassandra

=IF(D4="","",
IF(MONTH(TODAY())MONTH(D4),YEAR(TODAY())-YEAR(D4),
IF(AND(MONTH(TODAY())=MONTH(D4),DAY(TODAY())=DAY( D4)),
YEAR(TODAY())-YEAR(D4),(YEAR(TODAY())-YEAR(D4))-1))
)

Regards

Trevor


"cassandra" wrote
in message ...

I have if statement to get the current age. but if there is DOB is
blank the current age is 105.

DOB is D4 and the if statement is in Current age D5

=IF(MONTH(TODAY())MONTH(D4),YEAR(TODAY())-YEAR(D4),
IF(AND(MONTH(TODAY())=MONTH(D4),DAY(TODAY())=DAY( D4)),
YEAR(TODAY())-YEAR(D4),(YEAR(TODAY())-YEAR(D4))-1))



What if statment should i use to get Current age to be blank until
there is a date entered in the DOB.


Thanks


--
cassandra
------------------------------------------------------------------------
cassandra's Profile:
http://www.excelforum.com/member.php...o&userid=27026
View this thread: http://www.excelforum.com/showthread...hreadid=438908



  #4   Report Post  
cassandra
 
Posts: n/a
Default


Thanks for the help. I know there was a way to do it right.


--
cassandra
------------------------------------------------------------------------
cassandra's Profile: http://www.excelforum.com/member.php...o&userid=27026
View this thread: http://www.excelforum.com/showthread...hreadid=438908

  #5   Report Post  
Trevor Shuttleworth
 
Posts: n/a
Default

You're welcome. There's often a variety of ways to "do it right" as in this
case ... it's just finding them ;-)


"cassandra" wrote
in message ...

Thanks for the help. I know there was a way to do it right.


--
cassandra
------------------------------------------------------------------------
cassandra's Profile:
http://www.excelforum.com/member.php...o&userid=27026
View this thread: http://www.excelforum.com/showthread...hreadid=438908



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
Better Way to Code IF Statements? TheRobsterUK Excel Discussion (Misc queries) 4 July 18th 05 03:37 PM
Logical ELSE statements Ruth Excel Discussion (Misc queries) 2 June 23rd 05 03:23 PM
If Statements - how to do is like '%value%' Amanda Guenthner Excel Worksheet Functions 5 June 5th 05 02:44 AM
Nested IF statements John Simons Excel Worksheet Functions 14 February 16th 05 06:17 AM
If statements Mark Excel Worksheet Functions 3 November 2nd 04 08:39 PM


All times are GMT +1. The time now is 04:27 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"