Securing today using “Today” function.

ebeyert

Active Member
Joined
Sep 15, 2006
Messages
287
Use: Excel 2013

I have a formula in cell L10 which will enter today's date if “closed” or “canceled” is chosen in cell F10.

Example formula in cell L10: =IF(OR($F10={"Closed","Cancelled"}),TODAY(),"")

Formula works ok, expect: if I open the Excel sheet the next day, that day will be noted, etc, etc.

What I want is that at the moment (Day X) “closed” or “cancelled” is selected, that then that day (day X) is selected and that it will then no longer be adjusted.

Can someone assist me with this please?
Thanks
Best regards
Ellerd
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
You will need VBA to do this. I assume it is multiple cells not just F10 that could trigger the timestamp. Can you provide a sample of your data.
 
Upvote 0
login
 
Upvote 0
ABCDEFGHIJKLM
1
2
--
9Activity StatusStart dateDue DateDate Closed
10Action 1Open1 Dec15 Dec
11Action 2Closed2 Dec 13 Dec12 Dec
12Action 3Cancelled3 Dec22 Dec 12 Dec
13Action 4Planned18 Dec30 Dec
14Action 5Open4 Dec25 Dec
15
----
1000

<tbody>
</tbody>

This is a example of my sheet. Thanks for the support.
 
Last edited:
Upvote 0
You could use a Circular Reference for this.
Go to File - Options - Formulas
Check "Enable iterative calculation"

Make sure the conditions of the IF are FALSE (F10 does not = closed or cancelled) before you enter the formula.
Or cycle it from True to False back to True.

Assuming you put the formula in G10
=IF(OR($F10={"Closed","Cancelled"}),IF(ISNUMBER($G10),$G10,NOW()),"")
 
Upvote 0
This will check what is in column F any time cell in F10:F last row of data in F is change. If it is Closed or Cancelled it will put the date in L

Right click on the tab where your data is.

select view code
copy the code below into the sheet module

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lr As Long
Dim trow As Long
lr = Cells(Rows.Count, "F").End(xlUp).Row
trow = Target.Row
If Not Intersect(Target, Range("F10:F" & lr)) Is Nothing And (UCase(Range("F" & trow)) = "CLOSED" Or UCase(Range("F" & trow)) = "CANCELLED") Then
Range("L" & trow) = Date
End If

End Sub
 
Upvote 0
Forgot to add you will need to save the file as a macro enabled file type such as .XLSM
 
Upvote 0

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top