0

I'm using Excel 2010 and I would like to get the current date using an IF statement that does NOT refresh each time the worksheet is opened. Is there a way to do this with IF or is there another function?

  • With built in functions there is no way to do it. You could however create a little bit of VBA code that would compare the contents of a cell on opening the worksheet. If the cell is blank, it can insert the date. If the cell is not blank nothing happens. – Forward Ed Sep 17 '18 at 21:03
5

No. The point of TODAY() is to get the date of the latest recalculation. IF or any other functions won't help either because there's no function that stores the time it was first called and always returns that value

If you need to insert the current date without changing then you shouldn't use a function, instead insert it statically with Ctrl+; (semicolon). Similarly to insert NOW() without changing, use Ctrl+: (colon)

Insert a static date or time into an Excel cell

A static value in a worksheet is one that doesn’t change when the worksheet is recalculated or opened. When you press a key combination such as Ctrl+; to insert the current date in a cell, Excel “takes a snapshot” of the current date and then inserts the date in the cell. Because that cell’s value doesn’t change, it’s considered static.

Insert a date or time whose value is updated

A date or time that updates when the worksheet is recalculated or the workbook is opened is considered “dynamic” instead of static. In a worksheet, the most common way to return a dynamic date or time in a cell is by using a worksheet function.

To insert the current date or time so that it is updatable, use the TODAY and NOW functions, as shown in the following example. For more information about how to use these functions, see TODAY function and NOW function.

Insert the current date and time in a cell

  • Aww man you beat me to the punch! good work! – angelofdev Sep 17 '18 at 5:26
  • Wow. Nice to know. And much cleared than the documentation you linked you. That includes the + key and then it starts shifting cells. Without + (as is clear in your answer which uses the kbd tag) it just works. – Hennes Sep 17 '18 at 5:49
  • Sorry if you thought my question was stupid. Is there another function to use ? We are trying to eliminate keystrokes ? – Kimberly Meyers Sep 17 '18 at 5:50
  • Uhm, given the timing. Is that a reply to me ot to phuclv? – Hennes Sep 17 '18 at 5:55
  • 1
    @KimberlyMeyers I think you're reading too much into it. Phuclv was just explaining how exactly the TODAY() function works, an alternative as he mentions is the NOW() function. You could try putting the required date into a cell and referencing that instead of TODAY(), otherwise I don't believe you can accomplish what you're requiring specifically without using some VBA. – angelofdev Sep 17 '18 at 6:43
0

One way that may work for you is to use a circular reference and enable iterative calculation.

  • In Options select the Formulas tab and tick the Enable iterative calculation option.
  • In cell B1 enter the formula: =IF(A1<>"",IF(B1="",TODAY(),B1),"") (it will return a blank)
  • Format the cell as a date.
  • Add a value to cell A1 - text saying "Date:" would be a good choice.
    The current date should appear in cell B1 and not update.

Downsides

  • Editing the formula will recalculate it to 0 - or 00/01/1900 in date format.
  • Removing the value in cell A1 and adding it back will recalculate the date.
  • Users

Iteration is the repeated recalculation of a worksheet until a specific numeric condition is met. Excel cannot automatically calculate a formula that refers to the cell — either directly or indirectly — that contains the formula. This is called a circular reference. If a formula refers back to one of its own cells, you must determine how many times the formula should recalculate. Circular references can iterate indefinitely. However, you can control the maximum number of iterations and the amount of acceptable change.
Change formula recalculation, iteration, or precision

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.