This gives your results except for D5. The only value for Xct56 is D27 which is +4, unless you count the derived value in D10
Option Explicit
Dim chk As Boolean
Sub Test()
Dim r As Range, c As Range
Dim Col(), a
Dim x$
Col = Array(3, 4)
For Each a In Col
Set r = Range(Cells(2, a), Cells(Rows.Count, a).End(xlUp))
For Each c In r
If c.Value = "N/A" Then
x = SearchForward(c.Offset(, 2 - a), c.Offset(, 1 - a), a)
If x = 0 And chk = False Then
x = SearchBack(c.Offset(, 2 - a), c.Offset(, 1 - a), a)
End If
With c
.Value = x
.Interior.ColorIndex = 6
End With
End If
Next c
Next a
End Sub
Function SearchForward(ID As Range, Zeit, a)
Dim cel As Range, FA$
chk = False
With Columns(2)
Set cel = .Find(ID.Value, lookat:=xlWhole, after:=ID, searchdirection:=xlNext)
If Not cel Is Nothing Then
FA = cel.Address
Do
If cel.Row < ID.Row Then GoTo Exits
If cel.Offset(, -1) - Zeit <= 3 And cel.Offset(, a - 2) <> "N/A" Then
SearchForward = cel.Offset(, a - 2): chk = True
Exit Function
End If
Set cel = .FindNext(cel)
Loop Until cel.Address = FA
End If
End With
Exits:
SearchForward = 0
End Function
Function SearchBack(ID As Range, Zeit, a)
Dim cel As Range, FA$
With Columns(2)
Set cel = .Find(ID.Value, lookat:=xlWhole, after:=ID, searchdirection:=xlPrevious)
If Not cel Is Nothing Then
FA = cel.Address
Do
If cel.Row > ID.Row Then GoTo Exits
If cel.Offset(, -1) - Zeit >= -3 And cel.Offset(, a - 2) <> "N/A" Then
SearchBack = cel.Offset(, a - 2)
Exit Function
End If
Set cel = .FindNext(cel)
Loop Until cel.Address = FA
End If
End With
Exits:
SearchBack = 0
End Function