A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
You can't do that with a formula. You need to use VBA code for this.
Right-click the sheet tab.
Select 'View Code' from the context menu.
Copy the following code into the worksheet module that appears:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Range("A1"), Target) Is Nothing Then
Application.EnableEvents = False
If Range("A1").Value <> "" Then
Range("A2").Value = Date
Else
Range("A2").ClearContents
End If
Application.EnableEvents = True
End If
End Sub
If you want to datestamp multiple cells, it's slightly more complicated.