@iggydarsa @Staceycat
The suggestion in post #3 does not work (consistently) for me, even in that single cell. For example 25 April 2000 correctly returns 23 but 25 November 2000 incorrectly also returns 23.
Welcome to the MrExcel board!
So, suppose that is column A in any worksheet in the workbook, try this code after removing the previously suggested code.
Double-click on the ThisWorkbook module in the vba window and paste the code below on the resulting right hand pane.
This code would also process multiple dates if they were entered in column A (for example with Ctrl+Enter or by copy/paste from elsewhere)
If you only want this to work on limited worksheets within the workbook then please provide details (it would not matter if dates are not going to be input in column A of other sheets)
VBA Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim Changed As Range, c As Range
Dim DoB As Date
Set Changed = Intersect(Target, Sh.Columns("A"))
If Not Changed Is Nothing Then
Application.EnableEvents = False
For Each c In Changed
If IsDate(c.Value) Then
DoB = c.Value
c.Value = Year(Date) - Year(DoB) + (Date < DateSerial(Year(Date), Month(DoB), Day(DoB)))
c.NumberFormat = "General"
End If
Next c
Application.EnableEvents = True
End If
End Sub