+ Reply to Thread
Results 1 to 2 of 2

One more condition with Date Formula

  1. #1
    Registered User
    Join Date
    04-11-2005
    Posts
    48

    Question One more condition with Date Formula

    I got some great help yesterday.
    I have one more condition I would like to add onto a formula.
    Here is the formula that was given to me =IF(OR(A1="",A2=""),"",A2-A1)
    Here what I need information on now with.
    OK cell A1 will hold a date that material came in.
    Then cell A2 will hold today=() or now=() for todays date.
    Cell A3 will be the date that holds the time that has passed.
    What I need now is for cell A4 to hold a date. This will be the date that something ships out. What I need it to do is stop the counting in cell A3. I do not need for cells A1 and A3 to depend on this, just cell A3.
    If need be you can email me at [email protected]

  2. #2
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    both =today() and =now() are dynamic, meaning that each time your worksheet recalculates, this value will (or could) change. Any formulas based on this cell's value, likewise, will change whenever the worksheet recalculates.

    There are (to my knowledge) three ways to change the dynamic to static:

    1) VBA code *(see below)
    2) Copy/Paste Special.../Values
    3) Instead of having = TODAY() in A2, just enter the date using CTRL +
    ;(semi-colon). It will be the current date when entered and remain static. (thanks to Gord Dibben Excel MVP for tip #3)

    * You could add this code to your "Worksheet-Activate" module for the specific sheet in question:
    ------------------------
    Private Sub Worksheet_Activate()
    If Range("A2") = "" Then Range("A2") = Date
    End Sub
    ------------------------
    Of course, this will only affect one cell. If you require other cells to be similarly populated, this, as written, won't meet your needs.

    Now, after implementing one of the above, cell A2 will be static and A3 will stop calculating a differing value, allowing you enter your desired formula in A4.

    I hope one of these solutions will do what you ask.

    Bruce
    Bruce
    The older I get, the better I used to be.
    USA

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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