+ Reply to Thread
Results 1 to 11 of 11

Inserting a date based on results in another cell.

  1. #1
    Registered User
    Join Date
    07-21-2015
    Location
    Perth and Kinross
    MS-Off Ver
    Various
    Posts
    9

    Inserting a date based on results in another cell.

    Hi.

    I want a cell to display the date (static, not updated) if the adjacent cell has certain conditions.

    In A1 there will be 'Yes' or 'No' chosen by the user. If they choose 'Yes', I want A2 to display the current date and for it NOT to be updated.
    If they chose 'No'. A2 to remain blank.

    Something like this:

    =IF(A1="Yes",DATE,"")

    Any ideas?

    Thanks in advance.

    Silverfern.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Inserting a date based on results in another cell.

    in A2
    =IF(A1="Yes",TODAY(),"")
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    07-21-2015
    Location
    Perth and Kinross
    MS-Off Ver
    Various
    Posts
    9

    Re: Inserting a date based on results in another cell.

    Special-K

    Thanks for getting back to me. But the way I understand it, the TODAY function is not a date stamp. I will open the spreadsheet tomorrow and it'll have tomorrow's date in there. Excel 2010 Bible by John Walkenback states: "It's important to understand the TODAY function is not a date stamp. The function is updated whenever the work sheet is calculated."

    Obviously I won't know if I understand this correctly until tomorrow. Replacing TODAY with DATE does not solve the issue either.

    Your thoughts?

    Cheers.

    Silverfern.

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

    Re: Inserting a date based on results in another cell.

    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    07-21-2015
    Location
    Perth and Kinross
    MS-Off Ver
    Various
    Posts
    9

    Re: Inserting a date based on results in another cell.

    Tony

    Again, thanks very much for the info. But this formula will produce a date stamp if anything is entered into the cell. Not specific text. I want it date stamped if 'Yes' is entered and left blank if anything else is entered or it's blank.

    I do not understand why this does not work:

    =If(A1="Yes",Now(),"")

    It fits the layout (Logical Test, Value if True, Value if False) which is how the formula Special-K suggested works.

    I have tinkered with the formula and tried: =IF(A1="Yes","",IF(B1="",NOW(),B1)) but that does not work either.....

    Getting closer though.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Inserting a date based on results in another cell.

    NOW() is the same as TODAY() except it contains both Time and Date

    You have two choices,
    1. Set up your sheet to do iterations and set up a formula like in the link that Tony gave you or
    2. use Macros to date stamp. Are you opposed to that?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

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

    Re: Inserting a date based on results in another cell.

    The NOW() function will change each time a calculation is triggered.

    The best option (IMHO) is to use an event macro. The procedure is described at the link in my other reply. Are you interested in that method? We can fine tune the VBA code for you.

  8. #8
    Registered User
    Join Date
    07-21-2015
    Location
    Perth and Kinross
    MS-Off Ver
    Various
    Posts
    9

    Re: Inserting a date based on results in another cell.

    Morning

    I would like to try the event macro but have no idea on the appropriate procedure. I know how to get to the VBA editor, and that's about it. The link you provided states the procedure should be self explanatory. It is assuming an higher level of knowledge than I have.

    If you have the time I'd like to learn this.

    Further details of what I need are:

    In range E5:E100, if "Yes" entered, date stamp corresponding cell in column F.
    Blank or "NO" should result in no date stamp.
    There are 4 sheets within the workbook this is required for.
    Workbook attached for clarity.
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Inserting a date based on results in another cell.

    Okay, this code is modified from the Link Tony gave. First right click on the sheet tab > "View Code" This opens the VBA editor to the specific Sheet module that you want the code to work in.

    Copy and paste this code in.
    Please Login or Register  to view this content.
    You will need to repeat this on every sheet that you want this to happen in.
    Questions?

  10. #10
    Registered User
    Join Date
    07-21-2015
    Location
    Perth and Kinross
    MS-Off Ver
    Various
    Posts
    9

    Re: Inserting a date based on results in another cell.

    Yaaaheeeyyy!

    It works! Brilliant, and easy once you know how.

    No questions thanks. I see where the qualifier 'Yes' has been entered and I had figured out the range input and date adjustments. I'll keep this as I might be able to use this again. I can see I'm going to have to go on a VB course maybe.

    Thanks to you ChemistB and thanks to Tony. (Reputation added to both)

    Cheers.

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

    Re: Inserting a date based on results in another cell.

    You're welcome. We appreciate the feedback!

+ 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. Provide 3 different results based upon date differences
    By InterstateRentals in forum Excel General
    Replies: 4
    Last Post: 02-07-2014, 10:15 PM
  2. [SOLVED] inserting value based on another cell
    By monika_s in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-24-2013, 09:44 AM
  3. [SOLVED] Inserting daily quote based today date
    By vickicr888 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-10-2013, 12:56 PM
  4. Return Results Based on Date Range
    By ExcelSuduko in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-05-2013, 11:23 AM
  5. [SOLVED] How to add date to cell, and if already present avoid inserting new date over the existing
    By Mel56 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-09-2013, 01:11 PM
  6. Inserting specific date-based text
    By TobiasFK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-09-2010, 05:38 AM
  7. Replies: 1
    Last Post: 08-19-2009, 05:22 AM
  8. inserting a date into a cell
    By cmf in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-27-2008, 08:47 AM

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