Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Same as an Excel dateif calc getting age

Featured Replies

Hello,

I've been using this Excel formula:

=DATEDIF(DATE(MID(A2;LEN(A2)-6;2);MID(A2;LEN(A2)-8;2);LEFT(A2;LEN(A2)-9));TODAY();"y")

It has been used for calculating the age of a person from a social sec. number with 11 digits. The first six digits from the left is day of birth, day/month/year. Is it possible to get the same calculation in Filemaker?

Edited by snekkis

Yes, of course it is possible. Try =

Let ( [
yy = Middle ( SSN ; 5 ; 2 ) ;
cc = If ( yy < 30 ; 2000 ; 1900 ) ;
birthdate = Date ( Middle ( SSN ; 3 ; 2 ) ; Left ( SSN ; 2 ) ; cc + yy ) ;
today = Get ( CurrentDate )
] ;
Year ( today ) - Year ( birthdate ) - ( today < Date ( Month ( birthdate ) ; Day ( birthdate ) ; Year ( today ) ) )
)

where SSN is the name of the field holding the social security number.

Note:

  • The calculation must be unstored;
  • Since you mention Excel, I have used the 2029 rule to determine the century of the 6-digit date; you can change that at will;
  • The calculation returns the age in years (i.e. the number of complete years since the person's birthday) - so set the result type to Number.

Edited by comment

  • Author

Wonderful, and thanks!

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.