spill-the-beans
Board Regular
- Joined
- Feb 7, 2013
- Messages
- 52
Hello all,
At the moment I have a rather clumsy way of calculating someone's age based on today.
[TABLE="width: 1000"]
<tbody>[TR]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD]date of birth[/TD]
[TD]today[/TD]
[TD]year[/TD]
[TD]months[/TD]
[TD]answer[/TD]
[/TR]
[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]06/05/2008[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]=TODAY()[/TD]
[TD]=IF(MONTH(TODAY())>MONTH(B2),YEAR(TODAY())-YEAR(B2), IF(AND(MONTH(TODAY())=MONTH(B2),DAY(TODAY())>=DAY(B2)), YEAR(TODAY())-YEAR(B2),(YEAR(TODAY())-YEAR(B2))-1))[/TD]
[TD]=DATEDIF(B2,C2,"m")[/TD]
[TD]=INT(E2/12)&" years "&MOD(E2,12) & " months"[/TD]
[/TR]
</tbody>[/TABLE]
I have 2 questions:
1: Does anyone know how I would be able to have just three columns (B: the date of birth, C: today, and F: the answer) rather than have extra columns D and E in order to work out the answer in F?
2: Is it possible to work out someone's age based on their date of birth and a defined date? So instead of date of birth to today, I could put a different specific date in column C and have another formula to work out how old that person was on that specific date?
If anyone could help, I would much appreciate this.
At the moment I have a rather clumsy way of calculating someone's age based on today.
[TABLE="width: 1000"]
<tbody>[TR]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD]date of birth[/TD]
[TD]today[/TD]
[TD]year[/TD]
[TD]months[/TD]
[TD]answer[/TD]
[/TR]
[TR]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="class: xl65, width: 75, align: right"]06/05/2008[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]=TODAY()[/TD]
[TD]=IF(MONTH(TODAY())>MONTH(B2),YEAR(TODAY())-YEAR(B2), IF(AND(MONTH(TODAY())=MONTH(B2),DAY(TODAY())>=DAY(B2)), YEAR(TODAY())-YEAR(B2),(YEAR(TODAY())-YEAR(B2))-1))[/TD]
[TD]=DATEDIF(B2,C2,"m")[/TD]
[TD]=INT(E2/12)&" years "&MOD(E2,12) & " months"[/TD]
[/TR]
</tbody>[/TABLE]
I have 2 questions:
1: Does anyone know how I would be able to have just three columns (B: the date of birth, C: today, and F: the answer) rather than have extra columns D and E in order to work out the answer in F?
2: Is it possible to work out someone's age based on their date of birth and a defined date? So instead of date of birth to today, I could put a different specific date in column C and have another formula to work out how old that person was on that specific date?
If anyone could help, I would much appreciate this.