+ Reply to Thread
Results 1 to 2 of 2

days before birthday from date of birth

  1. #1
    Registered User
    Join Date
    11-12-2009
    Location
    Lucca, Italy
    MS-Off Ver
    Excel 2003
    Posts
    53

    days before birthday from date of birth

    I need to identify in VBA how many days before the a date of birth considering therefore only the day and month of the date of birth
    e.g

    now() = 14/04/2013
    DateOfB = 20/04/1984
    6 days

    Many thanks

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: days before birthday from date of birth

    If your DoB is in A1, try this...

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

    Note:
    1. now() will give you date AND time, so you only need to use =today() (which is 12/04/2013, not 14/04/2013)
    2. The formula is based on the USA date system of mm/dd/yy, so you *may* need to swap things around a bit
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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