+ Reply to Thread
Results 1 to 4 of 4

Automatically Populating a cell with the result of a calculation

  1. #1
    Registered User
    Join Date
    07-19-2009
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Automatically Populating a cell with the result of a calculation

    Hi, I am new to this site and was hoping somebody could help me with the following. I am attempting to automatically populate a cell with the result of a calculation. For example, Column A will be populated with a user-entered date. Column B contains a formula which works out the date difference between the user-entered date (in Column A) and a fixed date (in years, months, days format). What I am struggling to accomplish is to have Column B automatically populated with the date difference as soon as return is pressed after Column A has been populated. Any advice would be greatly appreciated. Thank you.

  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: Automatically Populating a cell with the result of a calculation

    A simple IF() should do it. In B3, for instance:

    =IF(A3 = "", "", DATEDIF(A3, $G$1, "d"))

    That formula assumes there is a fixed data in cell G1 all the rows are to calculate against. Of course you can change that reference or replace it with your current formula. This is mainly just to show how you can put the formulas in column B while column A is still blank and the formula sees that and stays "blank" until you put a value in.
    _________________
    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
    07-19-2009
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Automatically Populating a cell with the result of a calculation

    JBeaucaire, thank you so much for taking the time to reply. Your suggestion worked a treat and resolves the issue I raised through the forum. Once again, thank you for your help!

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

    Re: Automatically Populating a cell with the result of a calculation

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].


    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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