+ Reply to Thread
Results 1 to 17 of 17

if cell d2 has a value, todays date must apear in cell j2

  1. #1
    Registered User
    Join Date
    09-11-2013
    Location
    zastron,south africa
    MS-Off Ver
    Excel 2010
    Posts
    48

    if cell d2 has a value, todays date must apear in cell j2

    Hi all
    Basically I need a formula to show the current date in cell j2 that cell d2 got a value. The =today() formula donwork as the date must not change.
    Please help
    Creating POS

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

    Re: if cell d2 has a value, todays date must apear in cell j2

    this should do it for you

    http://spreadsheets.about.com/od/tip...24add_date.htm
    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

  3. #3
    Registered User
    Join Date
    09-11-2013
    Location
    zastron,south africa
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: if cell d2 has a value, todays date must apear in cell j2

    Good info, but not what I need, cell d2 gets its value from a userform, so I need a formula in cell j2 to add the date that d2 got its value. Thanx

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

    Re: if cell d2 has a value, todays date must apear in cell j2

    If you are getting your info from a userform, then some vba code to insert into your existing code.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-11-2013
    Location
    zastron,south africa
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: if cell d2 has a value, todays date must apear in cell j2

    Great! How do I make it apply to the whole column D and J?

  6. #6
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    935

    Re: if cell d2 has a value, todays date must apear in cell j2

    How about a formula like this in J2; you will need to activate Iteration / max = 1 in your Excel Options:

    =IF(ISBLANK(D2),"",IF(J2="",TODAY(),J2))
    Last edited by rollis13; 10-04-2013 at 04:08 AM.

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

    Re: if cell d2 has a value, todays date must apear in cell j2

    @rollis:

    Using Today() will change the date each time the sheet is opened on a different day. The OP is looking for a solution that fixes the date.

  8. #8
    Forum Contributor
    Join Date
    05-07-2013
    Location
    apple valley ca
    MS-Off Ver
    Excel 2007
    Posts
    110

    Re: if cell d2 has a value, todays date must apear in cell j2

    =IF(D2<>"",IF(J2="",NOW(),J2),"")

    THIS IS A LOOP FORMULA SO YOU MUST GO TO EXCEL OPTIONS/ FORMULAS.. UNDER "CALCLULATIONS OPTIONS" CHECK MARK "ENABLE ITERATIVE CALCULATION" THEN CHANGE THE "MAXIMUM ITERATIVE" TO 1
    what this will do is if cell D2 is blank.. nothing but the second you put anything in D2.. it will time stamp cell J2 and wont change

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

    Re: if cell d2 has a value, todays date must apear in cell j2

    try this:

    Please Login or Register  to view this content.

  10. #10
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    935

    Re: if cell d2 has a value, todays date must apear in cell j2

    @alansidman
    Did you test my formula ? have a try with NOW (format cell hh:mm) instead of TODAY so you won't have to wait a day and see if it changes.
    This is what IF(J2="",TODAY(),J2) is for.

    @xwarlock10x
    Thanks, didn't know how to translate the headings of the Option menus, I don't use english Excel.
    Last edited by rollis13; 10-04-2013 at 04:10 AM.

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

    Re: if cell d2 has a value, todays date must apear in cell j2

    rollis13: Yes. If I used your formula, then I get the today's date 10/3/2013. I then close the file and change the system date in my machine to 10/4/2013 and then open the file. All the dates in column J are now 10/4/2013. I believe that the OP wants those dates to stay constant at 10/3/2013.

    Alan

  12. #12
    Registered User
    Join Date
    09-11-2013
    Location
    zastron,south africa
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: if cell d2 has a value, todays date must apear in cell j2

    Hi all and thanx for the help. I tried both the formula and the code but to no success, nothing hapens when I enter the code, with the formula I get a circular error.
    Please advise me as to where I must enter the code? Currently its in the sheets code, but nothing is happening.

  13. #13
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    935

    Re: if cell d2 has a value, todays date must apear in cell j2

    @alansidman
    Works fine with my Excel 2003. The timestamp will not change even if you later update/change the contents of cell D2, it can be then changed only if you first delete D2.

    @simeonmein
    As said in posts #6 and #8 you need to activate the Iterative Calculation to avoid Circular error.

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

    Re: if cell d2 has a value, todays date must apear in cell j2

    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

  15. #15
    Registered User
    Join Date
    09-11-2013
    Location
    zastron,south africa
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: if cell d2 has a value, todays date must apear in cell j2

    @rollis13: I changed the calculation settings for formulas in options to 1, after this I got the circular error with no date apearing in cell j2. Can one not use a hlookup function?

    @alansidman: tried it and no success.

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

    Re: if cell d2 has a value, todays date must apear in cell j2

    See attached file. Did you remember to save as a macro enabled file. .xlsm
    Attached Files Attached Files

  17. #17
    Valued Forum Contributor rollis13's Avatar
    Join Date
    01-26-2012
    Location
    Cordenons
    MS-Off Ver
    Excel 2016 32bit - Win 11
    Posts
    935

    Re: if cell d2 has a value, todays date must apear in cell j2

    Please attach a sample of your sheet elsewise we will get into a never ending loop ;-)

+ 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. Todays Date in Cell
    By omletto in forum Excel General
    Replies: 4
    Last Post: 01-31-2011, 07:37 AM
  2. Image apear in cell
    By Tortus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-25-2010, 08:27 AM
  3. Filling cells with 3 different colors based on date in cell and todays date
    By chinookcrew in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-23-2009, 07:36 AM
  4. Replies: 3
    Last Post: 05-28-2008, 01:32 PM
  5. Replies: 1
    Last Post: 01-06-2006, 12:34 AM

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