+ Reply to Thread
Results 1 to 14 of 14

Autocalculate Age from Identity Card Number

  1. #1
    Registered User
    Join Date
    01-04-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007/10
    Posts
    6

    Autocalculate Age from Identity Card Number

    How to do formula to autocalculate age from Identity Card Number?
    e.g 110802018888 means the 1st 6 numbers is the birthday = 02/08/2011
    e.g. 090802018888 means the 1st 6 numbers is the birthday = 02/08/2009.
    e.g 980802018888 means the 1st 6 numbers is the birthday = 02/08/1998

    I tried to do the formula, but not valid for year after 2000 or before 2000
    =IF(LEN(K3)=11,12-LEFT(K3,1),(IF(LEN(K3)=12,112-LEFT(K3,2)))).

    The file is uploaded.
    Thank you very much.
    Attached Files Attached Files
    Last edited by suriawati; 01-04-2012 at 11:06 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: Autocalculate Age from Identity Card Number

    You have a problem in that there is no way for a formula to differentiate between, say, 1911 and 2011, or 1909 and 2009 with only a two digit year field.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: Autocalculate Age from Identity Card Number

    Agree..
    But if you take result that nobody can be over 100 you can use this:
    Attached Files Attached Files

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Autocalculate Age from Identity Card Number

    Another way would be to assume that you can't have an I.D. card before you are born, and you die before you get to one hundred!
    Please Login or Register  to view this content.
    Last edited by Marcol; 01-04-2012 at 06:34 AM.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: Autocalculate Age from Identity Card Number

    My result return one extra year depending on date: If today date is 4.1.2012 then you'll get:


    120103105716 result: 0
    120106105717 result: 1

    If Today's date is higher than IC date

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: Autocalculate Age from Identity Card Number

    My result return one extra year depending on date: If today date is 4.1.2012 then you'll get:


    120103105716 result: 0
    120106105717 result: -1

    If Today's date is higher than IC date

    Further on:

    110103105716 result: 1
    110106105717 result: 0

    For every other year.

    Edit: Rather minus than plus
    Attached Files Attached Files
    Last edited by zbor; 01-04-2012 at 07:05 AM.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: Autocalculate Age from Identity Card Number

    In the example data, my understanding was that one of the ages was 101 ... but I might be mistaken. People are living longer these days.

    Regards, TMS

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: Autocalculate Age from Identity Card Number

    If so then, as you said, no way to determine is it 1 or 101.
    This is up to 99

  9. #9
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Autocalculate Age from Identity Card Number

    I think zbor we might both be wrong!

    See the new formulae in columns B:C in this workbook

    Is there a minimum age for an ID card requirement?
    Attached Files Attached Files
    Last edited by Marcol; 01-04-2012 at 07:21 AM.

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: Autocalculate Age from Identity Card Number

    Yea, I've edited attachment at 12:05. You got previous one.. change + into - after first formula.

  11. #11
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Autocalculate Age from Identity Card Number

    Aye, the forum has been crashing on me all day, it's hard to keep up.
    I noticed that you posted one reply twice, did you get a warning about "Navigating away from the page" when you first tried to post?

    This workbook has your formula corrected for the record, and a possible minimum age (5) for holding an ID card solution.
    I realise that this doesn't give the result that the OP asks for but it covers an age group from 5 to 104.

    Just a thought.


    [EDIT]
    This post crashed, but sent the text without the attachment ...
    Attached Files Attached Files
    Last edited by Marcol; 01-04-2012 at 08:54 AM.

  12. #12
    Registered User
    Join Date
    01-04-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007/10
    Posts
    6

    Re: Autocalculate Age from Identity Card Number

    My 1st uploaded file might be with wrong formula to calculate the age that's why it return for 101 age instead of 1 year old of age. It should return as 1 year old of age.
    There is no minimum age in here (Malaysia) to make Identity Card Number.
    Rarely people lives more than 100 years of age in here.
    e.g. 110106105717 means the birth date 06/01/2011 (1st 6 numbers) rarely to see people born on the year 1911 with ID number anymore.
    Thank you everybody for your help.
    I must add in the DOB next to Identity Card Number and to get the actual Age (Below 100 years old).
    Thanks again
    Last edited by suriawati; 01-04-2012 at 11:18 PM.

  13. #13
    Registered User
    Join Date
    02-13-2017
    Location
    Singapore
    MS-Off Ver
    window 7
    Posts
    1

    Re: Autocalculate Age from Identity Card Number

    any one know how to calculate age of person with singapore nric? please help me email me at [email protected]

  14. #14
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,364

    Re: Autocalculate Age from Identity Card Number

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1