+ Reply to Thread
Results 1 to 4 of 4

Automatically editing formula

Hybrid View

  1. #1
    Registered User
    Join Date
    06-03-2008
    Posts
    2

    Automatically editing formula

    Hi

    I have entered a formula to calculate someone's age

    =DATEDIF("31/7/1981",$B$1,"y")

    - with the B1 cell having todays date (=today)
    - 31/7/1981 being a date of birth

    I was wondering if there is a way to set the cell up so that when inputting I only having to type in the person's date of birth and then this gets inserted into the correct part of the formula and then the cell shows their age?

    I just think this will make inputting a lot simpler and quicker to do, rather than having to edit the actual formula each time.

    Does my question make sense?

    Thanks very much for your help

    Hannah

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Just replace the hard coded DOB with a cell reference containing that date that you can manipulate....

    eg. =DATEDIF($A$1,$B$1,"y") where A1 contains the DOB you can edit.

    Note: The $ signs "freeze" the column/row references.. if you are going to copy the formula down/across, take out the $ from before the column/row reference.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-03-2008
    Posts
    2
    Thanks for your reply.

    That way would indeed work, but would involve another column and I want to try and avoid that as I need to fit my worksheet onto a single piece of A4 and hiding and unhiding a column is just as much 'effort' as editing the formula.

    Any other ideas?

    thanks again

    Hannah

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    I think then you would need a user input box, which requires code and perhaps a button to activate the user input box.

+ 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