Goldfield
New Member
- Joined
- Oct 29, 2008
- Messages
- 48
Hi everybody
I have two cells
A1: Birthday)
and
A2: Age)
Using VBA I want A2 to display the age if i type the birthday in A1 using a formula like this one
IF(MONTH(TODAY())>MONTH(A1),YEAR(TODAY())-YEAR(A1),IF(AND(MONTH(TODAY())=MONTH(A1),DAY(TODAY())>=DAY(A1)),YEAR(TODAY())-YEAR(A1),(YEAR(TODAY())-YEAR(A1))-1)))
or if I type the age in A2 i want A1 to display a birthday based on the formula
=EDATE(TODAY(),12*A2))
I tried to do it in VBA but it seemed to circle events.
Hope somebody can help
I have two cells
A1: Birthday)
and
A2: Age)
Using VBA I want A2 to display the age if i type the birthday in A1 using a formula like this one
IF(MONTH(TODAY())>MONTH(A1),YEAR(TODAY())-YEAR(A1),IF(AND(MONTH(TODAY())=MONTH(A1),DAY(TODAY())>=DAY(A1)),YEAR(TODAY())-YEAR(A1),(YEAR(TODAY())-YEAR(A1))-1)))
or if I type the age in A2 i want A1 to display a birthday based on the formula
=EDATE(TODAY(),12*A2))
I tried to do it in VBA but it seemed to circle events.
Hope somebody can help