Forum Discussion
IF Statement Concerns
- Apr 24, 2018
Hello,
what you want to achieve cannot be done with the NOW() formula. It will always update to the current date and time. If you want a time stamp that does not change, then you will need to use VBA.
This code will put a time stamp into column B when a cell in column A is changed by the user. Copy the code, then right-click the Sheet, select "View code" and paste the code into the code window.
Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Range("A:A")) Is Nothing Then Target.Offset(0, 1) = Now End If End Sub
Hi Jennifer
Here you go:
1. open excel
2. go to: File > Options
3. in popup window go to : Formulas
4. Check "Enable iterative calculation"
5. Change the value of "Maximum iterations:" from 100 to 1
6. click OK
Now suppose you have to enter the value A1 and get the output (Time) in B1 enter the following formula in B1
=IF(A1<>"",IF(B1="",NOW(),B1),"")
- Apr 24, 2018
Gourab Dasgupta Yes, this is possible, but it can have implications for other aspects of the workbook, where iterative calculation is not desired. Unless the user is absolutely sure what they are doing with this setting, I suggest avoiding this approach.
- Gourab DasguptaApr 24, 2018Iron Contributor
Hi
You are right, but as per present scenario the user is getting the exact output without need of having knowledge of advance excel. let her go through the solution and wait for the response. we are here to guide.
- Jennifer ClarkApr 24, 2018Copper Contributor
Thank you all, I ended up using the VB Script as that was the only way to ensure that the dates and times didn't change if someone accidentally clicked to calculate the sheet.