+ Reply to Thread
Results 1 to 30 of 30

Work out day's until birthday

Hybrid View

  1. #1
    Registered User
    Join Date
    09-24-2012
    Location
    England
    MS-Off Ver
    2013
    Posts
    55

    Work out day's until birthday

    Have just been playing around with a few thing's, working out age from TODAY - DOB and stuff, and thought I'd work out how many day's it was until a birthday...

    I'm not too sure how to do for some reason, I would have thought that TODAY-(DOB + age) would have given the answer, but it doesn't seem to be working out for me.

  2. #2
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Work out day's until birthday

    try this assuming birthday i.e. 4th january 1978 is in column A
    =DATEDIF(A2,TODAY(),"D") this will give you days till now from birthday
    change "D" to "Y" to get year and "D" to "M" to get month
    Last edited by hemesh; 10-19-2013 at 06:42 AM.
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  3. #3
    Registered User
    Join Date
    09-24-2012
    Location
    England
    MS-Off Ver
    2013
    Posts
    55

    Re: Work out day's until birthday

    DATEDIF doesn't come up prompted when I start typing the formula in, though it works, which is odd? (I thought all formula's came up?)

    OK I'm running into a similar problem, it's giving me the answer - 10105 (The DOB is 18/02/1986)

    Which is the serial number - but I'm not sure how to convert this to day's rather than years, /365.25 gives me 27/01/1900 which converted to general gives 27.665982 - which is the age rather than the amount of day's until the next birthday...

    Not sure where I'm slipping here, thanks though

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Work out day's until birthday

    Quote Originally Posted by Managerwork View Post
    DATEDIF doesn't come up prompted when I start typing the formula in, though it works, which is odd? (I thought all formula's came up?)
    See this for an explanation:

    http://www.cpearson.com/Excel/datedif.aspx
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Work out day's until birthday

    Try this to get complete details from date of birth to till date
    =DATEDIF(A2,TODAY(),"y")&" Years"&" "&DATEDIF(A2,TODAY(),"ym")&" Months"&" "&DATEDIF(A2,TODAY(),"md")&" Days"
    This is a age calculation from birthday
    Last edited by hemesh; 10-19-2013 at 06:57 AM.

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

    Re: Work out day's until birthday

    I presume you want the number of days from today to the next birthday. If so, you need to take the date of birth and use either today's year or next year, depending on when the birthdate actually falls.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    09-24-2012
    Location
    England
    MS-Off Ver
    2013
    Posts
    55

    Re: Work out day's until birthday

    Hi, OK I've figured it out a bit of a different way -

    =(B4+((C4+1)*365.25))-$D$1

    B4 = DOB

    C4 = Age

    D1 = Todays date


    Just had a look at your formula - it still (for me) gives the current age (formatted nicely!) rather than the amount of day's until the next birthday.

  8. #8
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Work out day's until birthday

    G'day

    Just putting my 2 cents worth

    Have you tried the forumla below. Cell A2 has your next birthday date.

    =A2-TODAY()

    This is my way of finding the your age. Cell A1 has you birthday date.

    =YEAR(TODAY())-YEAR(A1)
    Have I made you happy ??? If yes, please make me happy by pressing the http://www.excelforum.com/images/buttons/reputation-40b.png Add Reputation button in my post.
    Please don't forget to do the same to other contributors of this forum.

    Thanks
    I don't void confusion, I create it

  9. #9
    Registered User
    Join Date
    09-24-2012
    Location
    England
    MS-Off Ver
    2013
    Posts
    55

    Re: Work out day's until birthday

    Quote Originally Posted by ratcat View Post
    G'day

    Just putting my 2 cents worth

    Have you tried the forumla below. Cell A2 has your next birthday date.

    =A2-TODAY()

    This is my way of finding the your age. Cell A1 has you birthday date.

    =YEAR(TODAY())-YEAR(A1)
    Hello Ratcat - I've never really used the YEAR function before.

    That's better than the method I used as I had the current date In a cell reference rather than within the formula.

    Thanks!

  10. #10
    Valued Forum Contributor ratcat's Avatar
    Join Date
    03-07-2008
    Location
    Rural NSW, Australia
    MS-Off Ver
    Vista 2007
    Posts
    1,111

    Re: Work out day's until birthday

    Thanks !

    If your problem is solved, please mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

  11. #11
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,777

    Re: Work out day's until birthday

    take a look at these solutions
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  12. #12
    Registered User
    Join Date
    09-24-2012
    Location
    England
    MS-Off Ver
    2013
    Posts
    55

    Re: Work out day's until birthday

    Quote Originally Posted by popipipo View Post
    take a look at these solutions
    I'm looking at this solution at the moment -

    =IF(DATE(YEAR(TODAY()),MONTH(A1),DAY(A1))>=TODAY(),DATE(YEAR(TODAY()),MONTH(A1),DAY(A1))-TODAY(),DATE(YEAR(TODAY())+1,MONTH(A1),DAY(A1))-TODAY())

    And just getting my head around it, not too sure what's going on with it...

    IF=(DATE(YEAR(TODAY))),

    This section - this is defining the criteria for the if function?

    MONTH(A1),DAY(A1))>=TODAY(),
    =
    So this is the value if true? I don't get what this is doing, the month and the day of A1 equal to the month and day of TODAY.... ?

    DATE(YEAR(TODAY())

    Again I don't get this...


    Basically I really can't see the individual parts that are going on with this formula :/

    Cheers

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

    Re: Work out day's until birthday

    Quote Originally Posted by Managerwork View Post
    I'm looking at this solution at the moment ...
    Similar to mine in Post #15, but mine has an implied IF.

    If you look at Post #5 you will see what it is doing. Perhaps you are getting confused with all the brackets, as TODAY() has its own pair, so the comparison is:

    =IF(DATE(YEAR(TODAY()),MONTH(A1),DAY(A1)) >= TODAY(),

    or ... IF(adjusted_date >= today

    where adjusted_date is the date of birth with the year from today. Now, if that adjusted_date is greater than today then you can just subtract today from it to get the number of days till the next birthday. But if it is less than today (i.e. the DOB occurred in an earlier part of the year) then you must add 1 year onto the adjusted_date before subtracting today.

    An example - it is mid October now, but if someone had a date of birth in June then their birthday this year would already have taken place, so their next birthday will occur next year.

    Hope this helps.

    Pete

  14. #14
    Registered User
    Join Date
    09-24-2012
    Location
    England
    MS-Off Ver
    2013
    Posts
    55

    Re: Work out day's until birthday

    Quote Originally Posted by Pete_UK View Post
    Similar to mine in Post #15, but mine has an implied IF.

    If you look at Post #5 you will see what it is doing. Perhaps you are getting confused with all the brackets, as TODAY() has its own pair, so the comparison is:

    =IF(DATE(YEAR(TODAY()),MONTH(A1),DAY(A1)) >= TODAY(),

    or ... IF(adjusted_date >= today

    where adjusted_date is the date of birth with the year from today. Now, if that adjusted_date is greater than today then you can just subtract today from it to get the number of days till the next birthday. But if it is less than today (i.e. the DOB occurred in an earlier part of the year) then you must add 1 year onto the adjusted_date before subtracting today.

    An example - it is mid October now, but if someone had a date of birth in June then their birthday this year would already have taken place, so their next birthday will occur next year.

    Hope this helps.

    Pete

    Hi Pete - If I can just break it down a little bit that'd be ace, so the
    starting part with the IF Function;


    =IF(DATE(YEAR(TODAY()),MONTH(A1),DAY(A1)) >= TODAY(),

    I can really see what parts of that are the logical test, and what are the true / false responses.

    (DATE(YEAR(TODAY())

    is that the Logical test? Is that just determining whether it's today's date?

    Sorry about this, appreciate the help though.

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

    Re: Work out day's until birthday

    No, the DATE function takes three arguments - the year, the month and the day, so you are comparing a modified date given by:

    DATE(YEAR(TODAY()),MONTH(A1),DAY(A1))

    with today's date. I tried to show this with the emboldened black in Post #26. So we are producing a modified date by taking the day of the DOB and the month of the DOB but using the YEAR from today's date, and then comparing that with today's date, so the logical test is:

    DATE(YEAR(TODAY()),MONTH(A1),DAY(A1)) >= TODAY()

    The action-if-true is then:

    DATE(YEAR(TODAY()),MONTH(A1),DAY(A1))-TODAY()

    which means take that adjusted date and subtract today's date from it (as the modified date is in the future, as would occur with a November date-of-birth).

    The action-if-false is given by the remaining part of the formula, i.e.:

    DATE(YEAR(TODAY())+1,MONTH(A1),DAY(A1))-TODAY())

    which adds a further 1 onto the year part because the modified date is in the past (like a June date-of-birth).

    The formula that I gave works on the same basis, but is a bit more succinct.

    Hope this helps.

    Pete

  16. #16
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Work out day's until birthday

    I'll throw in my 2 cents worth:

    With the next Birthday in A1 enter this where you what the answer:

    Formula: copy to clipboard
    =IF(A1="","",DATEDIF(TODAY(),A1,"Y")&"  years, "&DATEDIF(TODAY(),A1,"ym")&  " months, and  "&DATEDIF(TODAY(),A1,"md") &" days")
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  17. #17
    Registered User
    Join Date
    09-24-2012
    Location
    England
    MS-Off Ver
    2013
    Posts
    55

    Re: Work out day's until birthday

    Quote Originally Posted by newdoverman View Post
    I'll throw in my 2 cents worth:

    With the next Birthday in A1 enter this where you what the answer:

    Formula: copy to clipboard
    =IF(A1="","",DATEDIF(TODAY(),A1,"Y")&"  years, "&DATEDIF(TODAY(),A1,"ym")&  " months, and  "&DATEDIF(TODAY(),A1,"md") &" days")

    I get a "NUM!" error from that formula for some reason...

  18. #18
    Registered User
    Join Date
    09-24-2012
    Location
    England
    MS-Off Ver
    2013
    Posts
    55

    Re: Work out day's until birthday

    Got to go out - just wanted to say a thanks for the posts, there's lot's of stuff I wouldn't (couldn't) have thought of here, and the formatting stuff is great. Will go through and test properly tomorrow morning

  19. #19
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Work out day's until birthday

    Another way:

    A
    B
    C
    1
    DOB
    Days to BD
    2
    04-Feb-72
    108
    B1: =EDATE(A1, CEILING(DATEDIF(A1, TODAY(), "m"), 12)) - TODAY()
    Entia non sunt multiplicanda sine necessitate

  20. #20
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,777

    Re: Work out day's until birthday

    @shg
    Nice short formula but:
    Birthday 1-oct-72 gives a result of -18 days
    It is true, but I think that is not a answer you want.

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

    Re: Work out day's until birthday

    With date of birth in A2, put this in B2:

    =DATE(YEAR(TODAY())+(DATE(YEAR(TODAY()),MONTH(A2),DAY(A2))<TODAY()),MONTH(A2),DAY(A2))-TODAY()

    examples:

    21/10/1973 2
    17/10/1973 363

    with today being 19/10/2013.

    Hope this helps.

    Pete

  22. #22
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,777

    Re: Work out day's until birthday

    I think there is a misundertanding about:
    'day of birth' and 'birthday'

    I think the input is day of birth because this is never changing.
    Birthday changes every year, I don't think you want to change this in your file every year.

    @ Managerwork
    Please help us

  23. #23
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Work out day's until birthday

    Good catch. Maybe this:

    A
    B
    C
    1
    DOB
    Days to BD
    2
    11-Oct-72
    357
    B2: =EDATE(A2, 12*(DATEDIF(A2, TODAY(), "y")+1)) - TODAY()


    ... assuming the question is how long until the next birthday.

  24. #24
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Work out day's until birthday

    I understand that all that is required is the number of days to the next birthday the date of which is known. Enter the date of the next birthday in A1 and use the following formula.

    Formula: copy to clipboard
    =IFERROR(IF(A1="","",DATEDIF(TODAY(),A1,"d")),"")

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

    Re: Work out day's until birthday

    It seems to me from post #1 that it is the date of birth that is known, so this has to be adjusted to the next birthday.

    Pete

  26. #26
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Work out day's until birthday

    Are we making this more complicated than need be?

    I see the OP is using Excel 2013 so maybe this:

    A2 = next birthdate, for example 8/4/2014

    =DAYS(A2,NOW())

  27. #27
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Work out day's until birthday

    shg's formula works best..an alternative (my 2 cents!)

    With DOB in A2

    =DATE(YEAR(TODAY())+(TEXT(A2,"mmdd")<TEXT(TODAY(),"mmdd")),MONTH(A2),DAY(A2))-TODAY()
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  28. #28
    Registered User
    Join Date
    09-24-2012
    Location
    England
    MS-Off Ver
    2013
    Posts
    55

    Re: Work out day's until birthday

    Quote Originally Posted by Ace_XL View Post
    shg's formula works best..an alternative (my 2 cents!)

    With DOB in A2

    =DATE(YEAR(TODAY())+(TEXT(A2,"mmdd")<TEXT(TODAY(),"mmdd")),MONTH(A2),DAY(A2))-TODAY()
    this worked

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. birthday calendar
    By prithi in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-20-2012, 08:25 AM
  2. Birthday
    By rph123 in forum Excel General
    Replies: 6
    Last Post: 02-04-2012, 11:55 AM
  3. My boy's 1st Birthday!
    By NBVC in forum The Water Cooler
    Replies: 10
    Last Post: 02-06-2009, 12:57 PM
  4. [SOLVED] Birthday calculations
    By JC in forum Excel General
    Replies: 10
    Last Post: 02-26-2006, 08:50 AM

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