Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

translating excel formula into

Forum home » Delegate support and help forum » Microsoft Access Training and help » Translating an Excel formula into an Access expression

Translating an Excel formula into an Access expression

ResolvedVersion 2003

Pasquale has attended:
Access Introduction course
Access Intermediate course
Access Advanced course

Translating an Excel formula into an Access expression

Hello,

I've got a spreadsheet that contains a list of birth dates of several people on a database I manage. In the cases where I don't have a date of birth, the date is listed as "unknown." I need to calculate all ages (as an integer value) and have come up with the following formula in Excel to do that:

=IF((AND(F4="unknown")),"unknown", (INT((TODAY()-F4)/365.25)))

How do I translate that formula into an Access expression that can be run as a query?

RE: Translating an Excel formula into an Access expression

Hi Pasquale,

Thank you for your question.

This formula should do the trick:

age: IIf([DateOfBirth]="Unknown","Unknown",DateDiff("yyyy",[DateOfBirth],Date()))

Create a query add the fields you need and then add a new field by using the expression builder and copy the formula above into the box and change the field as necessary.

I hope this helps.

Regards

Simon

Access tip:

Changing MS Programs Text Size

A handy way to increase or decrease the size of text in Microsoft Word, Microsoft PowerPoint, Microsoft FrontPage, or Microsoft Publisher, first, select the text you want to resize.

Then, to increase the font size, press CTRL+SHIFT+>.

To decrease the font size, press CTRL+SHIFT+<.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.