+ Reply to Thread
Results 1 to 5 of 5

Locking or freezing the TODAY() formula

  1. #1
    Registered User
    Join Date
    07-29-2020
    Location
    Pakistan
    MS-Off Ver
    2016, 365
    Posts
    20

    Locking or freezing the TODAY() formula

    I've looked around in the community about locking or freezing a current date, but I'm still having issues.

    That if i have marked tick on cell "C2 then today's date "11-11-2020" will auto populate into cell D2 i.e,. 11-11-2020 and that date will automatically changed to 12-11-2020 on very next day. Because of =TODAYS() function.

    My goal is to lock a date that's triggered by marking a tick and have that current date freeze until the tick is removed.

    My current sheet below shows the 10-11-2020 date which will change tomorrow and needs to be "locked" once the tick is marked and remain 10-11-2020 until the tick is removed

    Could anyone help me correct formula to what it needs to be?

    =IF(C2="Checked",TODAY(),"")

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,385

    Re: Locking or freezing the TODAY() formula

    You can't do it with a formula, for the reasons you've already outlined. You will need code. You have posted in the non-Excel section, so you'll need to clarify the platform, and then experts will be able to advise whether VBA would work for you or not.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-29-2020
    Location
    Pakistan
    MS-Off Ver
    2016, 365
    Posts
    20

    Re: Locking or freezing the TODAY() formula

    Thank you for replying promptly.

    Actually i have been using this on google sheets.

  4. #4
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Locking or freezing the TODAY() formula

    Quote Originally Posted by shabby01 View Post
    . . . My goal is to lock a date that's triggered by marking a tick and have that current date freeze until the tick is removed. . . .
    In Excel you'd need a Worksheet_Calculate or a Workbook_SheetCalculate event handler. I don't believe Google Sheets has anything comparable. You may need to use App Script to change the contents of D2 whenever you change C2. After changing C2, if the value of C2 isn't checked, D2 would have the formula =today(); otherwise, if the value of C2 is checked, D2 would have the constant value of the date on which C2 was last changed to checked.

    Something along the lines of

    Please Login or Register  to view this content.
    When Sheet1!C2 changes to checked, Sheet1D2 becomes its value as a constant. When Sheet1!C2 changes to anything else, Sheet1!D2's contents becomes the formula =TODAY(). I believe that's the only way to do this in Google Sheets net of embellishment to refer to named ranges for Sheet1!C2, Sheet1!D2 and the value to compare against the value Sheet1!C2 instead of using the constant "checked".

  5. #5
    Registered User
    Join Date
    07-29-2020
    Location
    Pakistan
    MS-Off Ver
    2016, 365
    Posts
    20

    Re: Locking or freezing the TODAY() formula

    It is google sheet.

+ 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] VBA Locking Range, if cell date value is less than today.
    By saudi_red_neck in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-23-2020, 07:47 AM
  2. [SOLVED] Help 'freezing' value of formulas when date becomes 'today'.
    By Big.Moe in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-14-2017, 10:57 AM
  3. Locking screen, Freezing rows and columns, or Other?
    By trstew in forum Excel General
    Replies: 1
    Last Post: 04-13-2017, 08:50 PM
  4. locking today formula inside an IF
    By dskvi27 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-27-2014, 02:53 PM
  5. Locking cells when today's date is passed.
    By Amir AbdRabu in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-29-2014, 09:09 AM
  6. Locking/Freezing contents of a column
    By LisaO in forum Excel General
    Replies: 4
    Last Post: 04-15-2009, 08:39 AM
  7. [SOLVED] Cell locking and program freezing
    By sbmjm in forum Excel General
    Replies: 0
    Last Post: 02-22-2005, 04:06 PM

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