You need a bit of VBA code for that.
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)
Dim cel As Range
If Not Intersect(Range("B:B"), Target) Is Nothing Then
Application.ScreenUpdating = False
Application.EnableEvents = False
For Each cel In Intersect(Range("B:B"), Target)
If cel.Value = "" Then
cel.Offset(0, 1).ClearContents
Else
cel.Offset(0, 1).Value = Now
End If
Next cel
Application.EnableEvents = True
Application.ScreenUpdating = True
End If
End Sub
Close the Visual Basic Editor.
Save the workbook in a format that supports macros (.xlsm, .xlsb or .xls, but
not .xlsx).
You'll have to allow macros when you open the workbook.