+ Reply to Thread
Results 1 to 6 of 6

Age Forumla using Date of Birth - Excel 2010

  1. #1
    Registered User
    Join Date
    02-05-2013
    Location
    Cardiff
    MS-Off Ver
    Excel 2010
    Posts
    18

    Exclamation Age Forumla using Date of Birth - Excel 2010

    I am creating a form using Excel 2010, the individuals using this form will be required to input their date of birth.
    I used the following formula to calculate their age -


    =IF(MONTH(TODAY())>MONTH(C13),YEAR(TODAY())-YEAR(C13),
    IF(AND(MONTH(TODAY())=MONTH(C13),DAY(TODAY())>=DAY(C13)),
    YEAR(TODAY())-YEAR(C13),(YEAR(TODAY())-YEAR(C13))-1))


    This formula has worked perfectly, however the default age is 113 and is displayed within the cell when the date of birth has not been entered.
    My question is that, is there a way to make the default age not visible when the date of birth is not entered? If so, how?

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Age Forumla using Date of Birth - Excel 2010

    How about:

    =IF(C13="","",DATEDIF(C13,TODAY(),"y"))

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Age Forumla using Date of Birth - Excel 2010

    Try this:

    =IF(C13="","",IF(MONTH(TODAY())>MONTH(C13),YEAR(TODAY())-YEAR(C13),
    IF(AND(MONTH(TODAY())=MONTH(C13),DAY(TODAY())>=DAY(C13)),
    YEAR(TODAY())-YEAR(C13),(YEAR(TODAY())-YEAR(C13))-1)))

    Changes shown in red. There are other ways of calculating age from date of birth using the DATEDIF function, for example.:

    =IF(C13="","",DATEDIF(C13,TODAY(),"y")&" years "&DATEDIF(C13,TODAY(),"ym")&" months "&DATEDIF(C13,TODAY(),"md") &" days")

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    02-05-2013
    Location
    Cardiff
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Age Forumla using Date of Birth - Excel 2010

    Thank you for your responses
    Last edited by SaleenaKhan; 02-05-2013 at 02:11 PM.

  5. #5
    Registered User
    Join Date
    02-05-2013
    Location
    Cardiff
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Age Forumla using Date of Birth - Excel 2010

    Quote Originally Posted by Andrew-R View Post
    How about:

    =IF(C13="","",DATEDIF(C13,TODAY(),"y"))
    Thank you for your help, however I need that formula in particular

  6. #6
    Registered User
    Join Date
    02-05-2013
    Location
    Cardiff
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Age Forumla using Date of Birth - Excel 2010

    Quote Originally Posted by Pete_UK View Post
    Try this:

    =IF(C13="","",IF(MONTH(TODAY())>MONTH(C13),YEAR(TODAY())-YEAR(C13),
    IF(AND(MONTH(TODAY())=MONTH(C13),DAY(TODAY())>=DAY(C13)),
    YEAR(TODAY())-YEAR(C13),(YEAR(TODAY())-YEAR(C13))-1)))

    Changes shown in red. There are other ways of calculating age from date of birth using the DATEDIF function, for example.:

    =IF(C13="","",DATEDIF(C13,TODAY(),"y")&" years "&DATEDIF(C13,TODAY(),"ym")&" months "&DATEDIF(C13,TODAY(),"md") &" days")

    Hope this helps.

    Pete

    Thank you ever so much, I used to corrected formula and it worked wonders

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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