Add timestamp via an IF comand ?

300zxev

New Member
Joined
May 16, 2011
Messages
2
Hi All

I was wondering if it is possible to insert the currect date via an IF command ... but have it as a fixed date or timestamp and not get updated every time the workbook opens.

For example if I have any data endered into column A ... column D enters the current date ... but fixed with that date until column A is updated again ?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
I can't think of any way to do it formulaically, but you can add some VBA code to your workbook:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Column = 1 Then
    Cells(Target.Row, 4).Value = Now()
End If

End Sub

This would go in the "worksheet" module for the worksheet you wanted to have set up this way. One small problem - it records the time the cell is edited, even if the edit is not a change - that is, if you click on (or cursor to) a cell in Column A and then hit F2 or click in the formula bar, then hit "enter" without making a change, the date in Column D will be updated, even if you didn't change anything.
 
Upvote 0
Hi All

Just incase any others want to know ...
I was able to perform this using the If command
=IF(A3<>"",IF(D3="",NOW(),D3),"")

This will leave my cells in D3 with the date of the modified A3
 
Upvote 0
Where are you putting that formula?

If I try it in D3, it gives me a circular reference warning, and then returns a zero. Elsewhere, I am not sure how D3 obtains a date / time when A3 is modified.
 
Upvote 0

Forum statistics

Threads
1,224,525
Messages
6,179,317
Members
452,905
Latest member
deadwings

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