+ Reply to Thread
Results 1 to 8 of 8

birthday calculator

Hybrid View

  1. #1
    Registered User
    Join Date
    07-21-2008
    Location
    New Zealand
    Posts
    35

    birthday calculator

    Hi,
    I am hopeless at remembering birthdays tbh - so rather than rely on family to remind me, I decided to make a spreadsheet that shows: D.O.B, current age (in years, months, days), and number of days remaining until next birthday.

    Please see attached - I can't figure out why the current age calculation is a month out. e.g 'Sebastian' was born on 16 Nov 2008, which makes him 3 months and 11 days old - but '=TODAY()-C16' yields "00 Years 4 Month(s) 12 Days"

    Also, 'Leah' has just her birthday - but now where it is supposed to give 'days until next birthday' it gives an error with the formula: '=DATEDIF(TODAY(),EDATE(C4,(YEAR(NOW())-YEAR(C4))*12),"d")'
    Attached Files Attached Files
    Last edited by Prium; 01-28-2009 at 05:36 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699

    Re: birthday calculator

    You can get age in years, months and days with this formula in D4

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

    and then days to next birthday

    =EDATE(C4,DATEDIF(C4,TODAY(),"y")*12+12)-TODAY()

    edit: format the cell as general......
    Last edited by daddylonglegs; 01-26-2009 at 06:01 PM.

  3. #3
    Registered User
    Join Date
    07-21-2008
    Location
    New Zealand
    Posts
    35

    Re: birthday calculator

    awesome cheers for that!

    how does that last formula work...can you please explain it to me in lay terms?

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699

    Re: birthday calculator

    EDATE adds a number of months to a date so, as I'm currently 21 years old then to get the date of my next birthday I need to add 22 years to my birthdate, i.e.

    =EDATE(Birthdate,Age*12+12)

    I can calculate my age with DATEDIF(Birthdate,TODAY(),"y") so that formula becomes

    =EDATE(Birthdate,DATEDIF(Birthdate,TODAY(),"y")*12+12)

    Now to calculate the number of days from today until that date we can just subtract TODAY() from the above, hence

    =EDATE(C4,DATEDIF(C4,TODAY(),"y")*12+12)-TODAY()

    where C4 contains birthdate.

    If you want you could embellish that formula to contain a message like "Birthday Today!" on the actual birthday, see the version I posted here (which also avoids using EDATE)

  5. #5
    Registered User
    Join Date
    07-21-2008
    Location
    New Zealand
    Posts
    35

    Re: birthday calculator

    Thanks man - very helpful!

  6. #6
    Registered User
    Join Date
    10-07-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: birthday calculator

    I have used these calculators and get the age but I get the error message when using the code to get the number of days to the next birthday. What am I doing wrong?

  7. #7
    Registered User
    Join Date
    04-04-2011
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: birthday calculator

    Quote Originally Posted by Prium View Post
    Hi,
    I am hopeless at remembering birthdays tbh - so rather than rely on family to remind me, I decided to make a spreadsheet that shows: D.O.B, current age (in years, months, days), and number of days remaining until next birthday.

    Please see attached - I can't figure out why the current age calculation is a month out. e.g 'Sebastian' was born on 16 Nov 2008, which makes him 3 months and 11 days old - but '=TODAY()-C16' yields "00 Years 4 Month(s) 12 Days"

    Also, 'Leah' has just her birthday - but now where it is supposed to give 'days until next birthday' it gives an error with the formula: '=DATEDIF(TODAY(),EDATE(C4,(YEAR(NOW())-YEAR(C4))*12),"d")'
    This formula shows 1 month difference

+ 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