Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Better Way to Code IF Statements? | Excel Discussion (Misc queries) | |||
Logical ELSE statements | Excel Discussion (Misc queries) | |||
If Statements - how to do is like '%value%' | Excel Worksheet Functions | |||
Nested IF statements | Excel Worksheet Functions | |||
If statements | Excel Worksheet Functions |