rounding a calculation

F

forest8

Hi there

I have included the following calculation as a control source in my document:

=(Now()-[DateofBirth])/365.25

Currently the value has a fixed format with 2 decimal places. I would like
to see it rounded to the nearest whole number.

What is the easiest way to set this up? My users don't understand what it
means if the student is 20.45 years old.

I would use

=Year[Now())-Year([DateofBirth]) but it doesn't take account of whether the
student has celebrated their birthday yet.

Thank you in advance for your help.
 
J

John W. Vinson

Hi there

I have included the following calculation as a control source in my document:

=(Now()-[DateofBirth])/365.25

Currently the value has a fixed format with 2 decimal places. I would like
to see it rounded to the nearest whole number.

What is the easiest way to set this up? My users don't understand what it
means if the student is 20.45 years old.

I would use

=Year[Now())-Year([DateofBirth]) but it doesn't take account of whether the
student has celebrated their birthday yet.

Thank you in advance for your help.

The usual way to calculate the age as of the latest birthday is:

DateDiff("yyyy", [DateOfBirth], Date()) - IIF(Format(Date(), "mmdd") >
Format([DateOfBirth], "mmdd"), 1, 0)

This calculates the number of years since the birth year, and subtracts one if
the birthday hasn't yet been reached this year.
 
D

De Jager

forest8 said:
Hi there

I have included the following calculation as a control source in my
document:

=(Now()-[DateofBirth])/365.25

Currently the value has a fixed format with 2 decimal places. I would
like
to see it rounded to the nearest whole number.

What is the easiest way to set this up? My users don't understand what it
means if the student is 20.45 years old.

I would use

=Year[Now())-Year([DateofBirth]) but it doesn't take account of whether
the
student has celebrated their birthday yet.

Thank you in advance for your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top