I want word to work out a persons age!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know you can do this in Excel using the 'datedif' function, but is it
possible to get the same result in word, using a table??

I have a form in word where you have to enter a date of birth, and I'm sure
it must be possible to get word to give you an age based on that date, rather
than having to type it in... Any help appreciated..

Thanks very much

Zed
 
G'Day Zed,

I already wish I hadn't answered this.

1. The DATEDIF function is peculiar to Excel. VBA (and
Word) have the DateDiff() Function. It is NOT easy to
use Datedif() to calculate an age.
We humans use a form of 'compound arithmetic' that
DateDiff() does not - it directly gives an age in DAYS.

To turn this into 'Human' Years, Months, Days is a pain!
See (Function Age (...) bottom of Page):
http://www.cpearson.com/excel/datedif.htm

2. In Word IT IS MUCH WORSE! You can not call VBA
Functions directly as you can in Excel.
See (for a reasonable fudge):
http://wordtips.vitalnews.com/Pages/T0631_Age_Calculation_with_Fields.html
 
Thanks Pat, it does seem a very complex way of doing it.. may be just easier
to type in the age!!
 
Especially as most people prefer to lie about it.


JoAnn Paules said:
It usually is. ;-)

--

JoAnn Paules
MVP Microsoft [Publisher]



Zed said:
Thanks Pat, it does seem a very complex way of doing it.. may be just
easier
to type in the age!!
 
I don't lie but I rarely ever state my age directly.

--

JoAnn Paules
MVP Microsoft [Publisher]



Jezebel said:
Especially as most people prefer to lie about it.


JoAnn Paules said:
It usually is. ;-)

--

JoAnn Paules
MVP Microsoft [Publisher]



Zed said:
Thanks Pat, it does seem a very complex way of doing it.. may be just
easier
to type in the age!!

:

G'Day Zed,

I already wish I hadn't answered this.

1. The DATEDIF function is peculiar to Excel. VBA (and
Word) have the DateDiff() Function. It is NOT easy to
use Datedif() to calculate an age.
We humans use a form of 'compound arithmetic' that
DateDiff() does not - it directly gives an age in DAYS.

To turn this into 'Human' Years, Months, Days is a pain!
See (Function Age (...) bottom of Page):
http://www.cpearson.com/excel/datedif.htm

2. In Word IT IS MUCH WORSE! You can not call VBA
Functions directly as you can in Excel.
See (for a reasonable fudge):

http://wordtips.vitalnews.com/Pages/T0631_Age_Calculation_with_Fields.html
--
Regards,
Pat Garard
Melbourne, Australia
_______________________

I know you can do this in Excel using the 'datedif' function, but is
it
possible to get the same result in word, using a table??

I have a form in word where you have to enter a date of birth, and
I'm sure
it must be possible to get word to give you an age based on that
date, rather
than having to type it in... Any help appreciated..

Thanks very much

Zed
 
Back
Top