+ Reply to Thread
Results 1 to 7 of 7

Can Excel convert a date to an age?

  1. #1
    Registered User
    Join Date
    08-12-2014
    Location
    Virginia
    MS-Off Ver
    2007
    Posts
    2

    Can Excel convert a date to an age?

    I know there are many ways to do this very simpily but I'm difficult. I don't want to put in a number then in the next column use a formula like today-A1. I want to be able put a date in, like 1/1/1990 and Excel convert that to 24. The specific file I'm taking over is over 700 entries and the age is put in as text so you have to constantly go in and update it. It would be impossible to keep track of. Can excel do that for me?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Can Excel convert a date to an age?

    The DATEDIF() function will do that:

    =DATEDIF(A1, TODAY(), "y")
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-12-2014
    Location
    Virginia
    MS-Off Ver
    2007
    Posts
    2

    Re: Can Excel convert a date to an age?

    But that requires you to have the date in A1 and the age would show up in A2 correct? All I want to see is the age.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,754

    Re: Can Excel convert a date to an age?

    What you are asking for can only be accomplished with VBA. Would that work for you?
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

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

    Re: Can Excel convert a date to an age?

    Then you'd have to enter the start date in the formula:

    =DATEDIF(DATE(1990,1,1)TODAY(),"y")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,754

    Re: Can Excel convert a date to an age?

    Here is a VBA solution

    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Can Excel convert a date to an age?

    I really have to interject, if you've taken over this file, then adding a column for "Date of Birth" or "DOB" would be the correct design decision. I don't think I've ever seen a database where people's age is depicted without that same database have the actual DOB included so the calculation is automatic.

    Your use of VBA to manually change a date to an age is STILL not solving the problem, it's just giving you an additional method to have the final result be less than optimal. A year later you're going to be back in this sheet typing in dates again to "convert" them to dates, by any of the methods being suggested.

    1) Add a DOB column
    2) Enter the dates one time
    3) Change the AGE column to one of the formulas given
    4) Never visit this issue ever again.

    Now that's "control" of your form.

+ 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. [SOLVED] How to convert exported text date to desired date format with excel vba.
    By sktneer in forum Excel Programming / VBA / Macros
    Replies: 25
    Last Post: 10-03-2013, 01:08 AM
  2. [SOLVED] How to convert Julian Date to regular excel date
    By Drehb4life in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-19-2013, 10:25 AM
  3. Convert Long Written Excel Date to Proper Date
    By DavidMichaelangelo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-19-2013, 04:47 PM
  4. [SOLVED] Convert date text to Excel date
    By kborgers in forum Excel General
    Replies: 6
    Last Post: 06-19-2012, 01:35 PM
  5. [SOLVED] Convert an Excel date to a date of my format in VBA
    By Sunnous in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2005, 12:45 PM

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