+ Reply to Thread
Results 1 to 4 of 4

date functions:yearfrac

  1. #1
    Registered User
    Join Date
    10-06-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    date functions:yearfrac

    i need to find out the age of my students in years and months. can anyone help me with the calculation for excel 2007. i have tried 'yearfrac' against the DOB and todays date, but no luck - it gives me a percentage of 100 not 365. HELP!!!

  2. #2
    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: date functions:yearfrac

    Welcome to the forum.

    See http://www.cpearson.com/excel/datedif.aspx
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    re: date functions:yearfrac

    Given your duplicate post I'm assuming you're still having issues implementing the DOB approach outlined in the link provided previously by shg ?

    In essence

    =DATEDIF(A1,TODAY(),"y")&" Year(s) and "&DATEDIF(A1,TODAY(),"ym")&" Month(s)"

    where A1 holds d.o.b

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

    re: date functions:yearfrac

    At one time at least there were some bugs with DATEDIF in Excel 2007. Here's a workaround that doesn't use DATEDIF

    =YEAR(TODAY())-YEAR(A1)-(TEXT(TODAY(),"mmdd")< TEXT(A1,"mmdd"))&" years "&MOD(MONTH(TODAY())-MONTH(A1)-(DAY(TODAY())< DAY(A1)),12)&" months"

+ 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