+ Reply to Thread
Results 1 to 11 of 11

Thread: 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 10:06 PM.

  2. #2
    Forum Guru TMShucks's Avatar
    Join Date
    07-15-2010
    Location
    Manchester, England
    MS-Off Ver
    MSO 2003 & 2007
    Posts
    6,238

    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

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    6,224

    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
    "Relax. What is mind? No matter. What is matter? Never mind!"

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

    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!
    =DATE(IF(LEFT(A2,2)*1<=YEAR(TODAY())-2000,2000+(LEFT(A2,2)*1),1900+(LEFT(A2,2)*1)),MID(A2,3,2)*1,MID(A2,5,2)*1)
    Last edited by Marcol; 01-04-2012 at 05:34 AM.
    If you need any more information, please feel free to ask.

    However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    6,224

    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
    "Relax. What is mind? No matter. What is matter? Never mind!"

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    6,224

    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 06:05 AM.
    "Relax. What is mind? No matter. What is matter? Never mind!"

  7. #7
    Forum Guru TMShucks's Avatar
    Join Date
    07-15-2010
    Location
    Manchester, England
    MS-Off Ver
    MSO 2003 & 2007
    Posts
    6,238

    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
    Excel 2007
    Posts
    6,224

    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
    "Relax. What is mind? No matter. What is matter? Never mind!"

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

    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 06:21 AM.
    If you need any more information, please feel free to ask.

    However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.

  10. #10
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    6,224

    Re: Autocalculate Age from Identity Card Number

    Yea, I've edited attachment at 12:05. You got previous one.. change + into - after first formula.
    "Relax. What is mind? No matter. What is matter? Never mind!"

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

    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 07:54 AM.
    If you need any more information, please feel free to ask.

    However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.

  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 10:18 PM.

+ 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.2.0